wndproc.cpp
- 概要:Windows message の処理
- 必要ヘッダ:windows.h, resource.h
#include <windows.h>
#include "resource.h"
// Prototype
BOOL OnCmnd(HWND, UINT, WPARAM, LPARAM);
BOOL OnPaint(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK WndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
switch( uMsg )
{
case WM_COMMAND:
if(!OnCmnd(hwnd, uMsg, wParam, lParam))
return( DefWindowProc( hwnd, uMsg, wParam, lParam) );
break;
case WM_PAINT:
if(!OnPaint(hwnd, uMsg, wParam, lParam))
return( DefWindowProc( hwnd, uMsg, wParam, lParam) );
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
return( DefWindowProc( hwnd, uMsg, wParam, lParam ) );
}
return 0;
}