-
Notifications
You must be signed in to change notification settings - Fork 171
Closed
Description
When a hWnd is not specified to set timer, and it is checked in a peekmessage loop
- WM_TIMER seems to fire instantly, instead of after the time period has expired as per on Windows XP with NTVDM. i.e should be after 10 seconds in this example code.
- WM_TIMER doesn't fire again after clicking OK on message box in this test app, unless hit ALT+TAB. On Windows XP it will fire again on timer without needing to do this.
If a hwnd is specified, the WM_TIMER is correctly sent to the wndproc handler as expected.
Example code:
SetTimer(NULL,NULL,10000,NULL);
BOOL fRetVal = TRUE;
// classic Win3.1 peek message loop
for(;;)
{
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_TIMER)
{
MessageBox(hwnd,"Hit Timer","Timer!!",MB_OK);
}
if (msg.message == WM_QUIT)
return TRUE;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
// check if need to do background processing, otherwise call WaitMessage
WaitMessage();
}
Environment (please complete the following information):
Windows 11 21H2 22000.739
Trace and sample program (MSVC 1.52 exe+source) attached
MSGTST.zip
trace.txt
.
Metadata
Metadata
Assignees
Labels
No labels