最終更新:2020-04-21 (火) 18:20:16 (1459d)  

WindowProc
Top / WindowProc

ウィンドウプロシージャ

ウィンドウへ送信されたメッセージを処理する、アプリケーション定義のコールバック関数

https://docs.microsoft.com/ja-jp/previous-versions/windows/desktop/legacy/ms633573(v=vs.85)

LRESULT CALLBACK WindowProc(
  HWND hwnd,      // ウィンドウのハンドル
  UINT uMsg,      // メッセージの識別子
  WPARAM wParam,  // メッセージの最初のパラメータ
  LPARAM lParam   // メッセージの 2 番目のパラメータ
);

  • LRESULT CALLBACK MainWndProc(
        HWND hwnd,        // handle to window
        UINT uMsg,        // message identifier
        WPARAM wParam,    // first message parameter
        LPARAM lParam)    // second message parameter
    { 
     
        switch (uMsg) 
        { 
            case WM_CREATE: 
                // Initialize the window. 
                return 0; 
     
            case WM_PAINT: 
                // Paint the window's client area. 
                return 0; 
     
            case WM_SIZE: 
                // Set the size and position of the window. 
                return 0; 
     
            case WM_DESTROY: 
                // Clean up window-specific data objects. 
                return 0; 
     
            // 
            // Process other messages. 
            // 
     
            default: 
                return DefWindowProc(hwnd, uMsg, wParam, lParam); 
        } 
        return 0; 
    } 

デフォルト

関連