1.控制代碼:資源的表示。類似於指標
hicon 圖示控制代碼
hcursor 游標控制代碼
hwnd 視窗控制代碼
hinstance 應用程式例項控制代碼
2.msg structure
hwnd
message:訊息號
wparam:關於訊息的附加資訊
lparam:關於訊息的附加資訊
time:說明訊息投遞的時間
pt:投遞訊息的時候,游標(滑鼠)的螢幕座標
3.windows程式的入口函式
int winapi winmain(
__in hinstance hinstance, //handle current instance
__in hinstance hprevinstance,//handle to previous instance
__in lpstr lpcmdline, //command line
__in int ncmdshow //show state
);4.視窗類
typedef struct wndclass, *pwndclass;
5.建立視窗
hwnd createwindow(
__in lpctstr lpclassname, //類名
__in lpctstr lpwindowname, //視窗的名字(即標題)
__in dword dwstyle, //視窗的型別
__in int x, //視窗左上角的座標
__in int y,
__in int nwidth,
__in int nheight,
__in hwnd hwndparent,
//父視窗控制代碼
__in hmenu hmenu, //選單
__in hinstance hinstance,
__in lpvoid lpparam //主要跟多文件程式有關
);
MFC的一些記錄
型別 mfc 將c 的關鍵字用巨集定義成以下內容。mfc型別 意思 c 型別 bool,boolean 布林型boolean byte 1 位元組數值型 char word 2 位元組數值型 short dword 4 位元組數值型 int uint 無符號整型 unsigned int void ...
MFC一些理解
重點 應用程式啟動機制。視窗處理。動態建立,動態判斷。序列化。訊息對映。視窗引數初始化 defwindowproc被註冊成視窗處理函式 設定了新建立的hook 用於視窗建立時先呼叫hook函式 將視窗物件和視窗控制代碼做對映關係儲存。建立視窗 解除安裝hook messagemap儲存了父類全域性函...
MFC一些語法筆記
1.類似c語言sprintf的用法 cstring str1 str1.format t id是 d i 把變數i的值變成字串 t是乙個巨集,作用是讓你的程式支援unicode編碼。因為windows使用兩種 字符集ansi和unicode,前者就是通常使用的單 位元組方式,但這種方式處理像中文這樣...