After created the window, i started a timer to do sth. the code like this:
SetTimer(hWnd, 1, 40, NULL); //tick each 40 ms.
I traced the last error, which was 0. but i cannot receive wm_timer! code like this:
case WM_TIMER:
{
//...
}
My IDE is VS2010, and OS is Windows7, so is there some speical case about my used environment?
P.S. okay i provide more code, it’s a win32 app so in WinMain:
HWND hWnd = CreateWindow(...); //style : WS_POPUP | WS_VISIBLE , return is good
SetTimer(hWnd, 1, 40, NULL); //return is good too.
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
and the WndProc:
switch(message)
{
case WM_TIMER:
{
DebugBreak(); //no reaction
}
break;
.......
}
WM_TIMERwon’t fire if you’re failing to consume other messages, as they will take priority. One cause of that, for example, is not correctly processingWM_PAINTmessages (you mustBeginPaint()/EndPaint())