http://bugs.winehq.org/show_bug.cgi?id=10343
Summary: SetTimer won't wait for specified time Product: Wine Version: 0.9.48. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: wine-user AssignedTo: wine-bugs@winehq.org ReportedBy: dmda@yandex.ru
Windows supports the following semantic for SetTimer():
hTimer = SetTimer(0, MY_ID, TIMEOUT, NULL); note: hWnd is zero, callback is NULL.
In this case Windows sends WM_TIMER to the thread queue after specified TIMEOUT milliseconds with wParam==hTimer returned by the function (not MY_ID! and this is because of zero hWnd!) When SetTimer is called this way it returns somewhat special in hTimer, for example 0x7edc.
Under wine, it returns 1 and sends WM_TIMER immediately, regardless of TIMEOUT (I tried with 6000ms==6s)
Reference: MSDN: If the function succeeds and the hWnd parameter is NULL, the return value is an integer identifying the new timer. An application can pass this value to the KillTimer function to destroy the timer.