Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace MoveNoneBoderForm{ public partial class
Time of Update: 2018-12-04
首先必須瞭解Windows的訊息傳遞機制,當有滑鼠活動訊息時,系統發送WM_NCHITTEST 訊息給表單作為判斷訊息發生地的根據。假如你點擊的是標題列,表單收到的訊息值就是 HTCAPTION ,同樣地,若接受到的訊息是 HTCLIENT,說明使用者點擊的是客戶區,也就是滑鼠訊息發生在客戶區。當重載表單的 WndProc 方法時,可以截獲 WM_NCHITTEST 訊息並改些該訊息,當判斷滑鼠事件發生在客戶區時,改寫改訊息,發送 HTCAPTION 給表單,這樣,表單收到的訊息就時
Time of Update: 2018-12-04
早上一來看到園子裡有篇文章是說註冊快速鍵,一看用的是hook,好多的代碼,下面是我以前用的代碼:using System;using System.Runtime.InteropServices;namespace SystemHotKey{ public delegate void HotkeyEventHandler(int HotKeyID); public class Hotkey : System.Windows.Forms.IMessageFilter {
Time of Update: 2018-12-04
4種方法 對比: private void Form2_Load(object sender, EventArgs e) { string str = "這心情就像那 低熱量的雪糕,淡淡的不夠呼味道,總覺得少了什麼"; string[] a; skyvu.Tester tester = new skyvu.Tester(100000); richTextBox1.AppendText(
Time of Update: 2018-12-04
try...{ string filename;SaveFileDialog sfd = new SaveFileDialog();sfd.Title = "請選擇將匯出的EXCEL檔案存放路徑";sfd.Filter="excel文檔(*.xls)|*.xls";//sfd.OpenFile(); sfd.ShowDialog();if (sfd.FileName != "")...{if(sfd.FileName.LastIndexOf(".xls")<=0)...{sfd.Fil
Time of Update: 2018-12-04
前段時間,S2的徐*同學去了一家作核能的企業做軟體測試,在應聘的時候出了這樣一道題目。寫出string類的建構函式,拷貝建構函式,解構函式,賦值函數。 這道題目是一道相當經典的C++開發題目,是面試C++程式員時經常考的,但這次無奈徐*碰上了,為什麼呢?因為徐* 入職後作的是白盒測試。#include<iostream>using namespace std;class String{public: String(const char *str=NULL);
Time of Update: 2018-12-04
c# AttributeUsage的使用在我們開發中是十分常見的,那麼我們瞭解c# AttributeUsage的基本情況從何入手呢?那麼本文就向你詳細介紹相關的內容。 C# AttributeUsage的使用是如何的呢?首先讓我們來瞭解一下什麼是AttributeUsage類它是另外一個預定義屬性類別,AttributeUsage類的作用就是協助我們控制定製特性的使用。其實AttributeUsage類就是描述了一個定製特性如和被使用。C#
Time of Update: 2018-12-04
MessageBox("訊息內容", "傳回值 確定1",MessageBoxButtons.OK,MessageBoxIcon.Question); MessageBox("訊息內容",, "傳回值 確定1 取消2",MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);MessageBox("訊息內容", "傳回值 終止3 重試4 忽略5",MessageBoxButtons.AbortRetryIgnore,
Time of Update: 2018-12-04
//SPtr.h#ifndef S_PTR_H#define S_PTR_Htemplate <typename T0, typename T1 = unsigned int> class SPtr{ template <typename T0, typename T1> friend class SPtr;public: SPtr(T0 * ptr = 0) :ptr_(ptr), use_(new T1(1)) {} SPtr(const SPtr &
Time of Update: 2018-12-04
C++的文法過於精巧,以致很多同學不能很好地理解。本文舉幾個小例子,供讀者思考。1、 inline和virtual#include <iostream>class A{public: virtual inline void func() { std::cout << "A::func" << std::endl; }};class B:public A{public: virtual inline void
Time of Update: 2018-12-04
標籤:經典 C語言 編程 垃圾 絕對能夠測試你的C語言功力的幾個問題 答案 垃圾題目 絕對能夠測試你的C語言功力的幾個問題http://www.bccn.net/Article/kfyy/cyy/jszl/200607/4181.html 解答: 垃圾題目,這種題也被作為經典?垃圾垃圾 1、strlen(str)錯誤操作,可能導致程式崩潰sizeof(str)值為102、strcpy
Time of Update: 2018-12-04
#include <stdio.h>int main(void){ FILE * file = popen("ls", "r"); int i; for(i=0; ;++i) { char buffer[1024+4]; fgets(buffer, 1024, file); if(feof(file)) break; printf("%s", buffer); } printf("%d\n", i); pclose(file); return
Time of Update: 2018-12-04
函數模板應用樣本//test.htemplate <typename M,typename N>M add(M a,N b){ return a+b;}//test.cpp#include <iostream>#include "test.h"using namespace std;void main(){ int a=15; float d=-2.8f; double b=12.5; char
Time of Update: 2018-12-04
去年參加ACM大賽遇見這個題,不知道怎樣解決,今天終於解決,原來這麼簡單,只需要用__int64 #include <iostream>using std::cout;using std::endl;int main(){ __int64 sum=0,multiply=1; for (int i=1;i!=50;++i) { multiply*=2; sum+=multiply; } cout<<sum<<endl; return
Time of Update: 2018-12-04
c++中函數的傳回值也可以是指標類型,但是這個指標類型必須是非函數內部的局部的地址,或者是NULL。如:int* SwpInt(int *a,int *b){ int c; c=*a; *a=*b; *b=c; return a;}這個函數返回的指標是安全的,因為a不是函數內的某個局部變數的地址。char *point(){ char pt2; pt2="B"; return
Time of Update: 2018-12-04
相信步驟大家都知道,下面上成果 代碼如下,英文系統沒有中文IME,而且打中文居然是亂碼,不知道咋整,只能用英文注釋了 /*the key ideal is to call the function "mlfMrank" which is created by matlab complier,and i used the command "mcc -B csharedlib:test mrank.m" to generate the c share libaraywhich
Time of Update: 2018-12-04
c++中允許函數的嵌套調用,但不允許函數的嵌套定義,例如:#include<iostream.h>int SwpInt(int *a,int *b){ int c; c=*a; *a=*b; *b=c; return a;}void main(){ int e=12; int
Time of Update: 2018-12-04
explicit用來防止由建構函式定義的隱式轉換。要明白它的作用,首先要瞭解隱式轉換:可以用單個實參來調用的建構函式定義了從形參類型到該類類型的一個隱式轉換。例如:class things{ public: things(const std::string &name = ""): m_name(name),height(0),weight(10){} int CompareTo(const things &
Time of Update: 2018-12-04
c語言標頭檔及其函數2007-08-14 13:29出處:http://hi.baidu.com/insp/blog/item/5a91843952f2fef13b87ce5c.html標頭檔 ctype.h 函數列表<>函數類別 函數用途 詳細說明字元測試 是否字母和數字 isalnum是否字母 isalpha是否控制字元 iscntrl是否數字 isdigit是否可顯示字元(除空格外) isgraph是否可顯示字元(包括空格)
Time of Update: 2018-12-04
下面以一個例子簡單的說下c++程式計時的方法#include <iostream>#include <ctime>using namespace std;void main( ){ clock_t start,finish; start=clock(); int one; int& rone=one; one=5; cout<<"one:"<<one<<endl; cout<<"rone:"<<rone&