關於 windows 所有訊息,
請上 MSDN 查詢, 這裡只列出以後比較常用的訊息..

Window Display
1. 訊息函數:case WM_SHOWWINDOW:
2. 預設回應函數:
OnCreate(HWND hWnd,
         WM_SHOWWINDOW,
         WPARAM wParam,
         LPARAM lParam);

Window Activation
1. 訊息函數:WM_ACTIVATE
2. 預設回應函數:
OnActivate(HWND hWnd,
           WM_ACTIVATE,
           WPARAM wParam,
           LPARAM lParam);


Value Description
a. WA_ACTIVE: Used to activate the window
b. WA_INACTIVE: Used to deactivate the window without using the mouse,
                for example by pressing Alt+Tab
c. WA_CLICKACTIVE: Used to activate the window using the mouse

Window Painting
1. 訊息函數:WM_PAINT
2. 預設回應函數:
OnPaint(HWND hWnd,
        WM_PAINT,
        WPARAM wParam,
        LPARAM lParam);

Window Sizing
1. 訊息函數:WM_SIZE
2. 預設回應函數:
OnSize(HWND hWnd,
       WM_SIZE,
       WPARAM wParam,
       LPARAM lParam);

Window Moving
1. 訊息函數:WM_MOVE
2. 預設回應函數:
OnMove(HWND hWnd,
       WM_MOVE,
       WPARAM wParam,
       LPARAM lParam);

Anytime  Messages
函數名稱:
LRESULT SendMessage(HWND hWnd,
                    UINT Msg,
                    WPARAM wParam,
                    LPARAM lParam);

Ex: LPCTSTR strMsg = L"This message was sent";
    SendMessage(hWnd,
                WM_SETTEXT,
                0,
                (LPARAM)(LPCTSTR)strMsg);

創作者介紹
創作者 Edison 的頭像
Edison

藍影

Edison 發表在 痞客邦 留言(0) 人氣()