// 主消息循环:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
static int cxChar=0,cyChar=0;
HBRUSH brush;
HWND btnhwnd1,btnhwnd2,btnhwnd3;
static int i=0;
RECT rect={10,10,30,30};
switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// 分析菜单选择:
switch (wmId)
{
case IDM_HELP_ABOUT:
DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, About);
break;
case IDM_FILE_EXIT:
DestroyWindow(hWnd);
break;
case IDC_PUSHBTN3:
SendMessage(hWnd,WM_CLOSE,0,0);
memset(HWpotArr,0,MAX_POINTNUM);
break;
case IDC_PUSHBTN2:
InvalidateRect(hWnd,NULL,TRUE);
memset(HWpotArr,0,MAX_POINTNUM);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_CREATE:
LoaResourceImage(hWnd,MAKEINTRESOURCE(IDM_IMAGE),RT_BITMAP,0,0,0,Screen_height,Screen_width); break;
case WM_DESTROY:
CommandBar_Destroy(g_hWndCommandBar);
PostQuitMessage(0);
break;