不知道为什么拖动边框或者最大最小化会使定时器停止,求解释消息的机制,萌新求解释┭┮﹏┭┮
LRESULT CALLBACK wndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
{
PAINTSTRUCT paintStruct;
switch (message)
{
case WM_TIMER:
Game_Paint(hwnd);
return 0;
case WM_PAINT:
g_hdc = BeginPaint(hwnd,&paintStruct);
Game_Paint(hwnd);
EndPaint(hwnd,&paintStruct);
ValidateRect(hwnd,NULL);
return 0;
case WM_KEYDOWN:
if (wparam == VK_ADD)
{
DestroyWindow(hwnd);
}return 0;
case WM_DESTROY:
Game_Cleanup(hwnd);
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(hwnd,message,wparam,lparam);
}
}