I have a console application that is using a DLL file that uses a SetTimer()
call to create a timer and fire a function within itself. The call is below:
Very simple timer without Windows
MSG Msg;
UINT TimerId = (UINT)SetTimer(NULL, 0, 0, NULL); // 0 minute
while (TRUE)
{
GetMessage(&Msg, NULL, 0, 0);
if (Msg.message == WM_TIMER)
{
KillTimer(NULL, TimerId);
cout << "timer message\n";
TimerId = (UINT)SetTimer(NULL, 0, 60000, NULL); // one minute.
}
DispatchMessage(&Msg);
}