I found the best implementation to be as follow:
#define TIMER1 1001
#define TIMER2 1002
SetTimer(hWndMainWnd, // handle to main window
TIMER1, // timer identifier
1000,
NULL); // no timer callback
SetTimer(hWndMainWnd, // handle to main window
TIMER2, // timer identifier
5000,
NULL); // no timer callback
Then, as part of the main event loop:
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_TIMER:
if (wParam == TIMER1)
{
// do something1
}
else
if (wParam == TIMER2)
{
// do smoething2
}
break;