I have three timers
Code:
#define IDT_TIMER1 101
#define IDT_TIMER2 102
#define IDT_TIMER3 103
case WM_CREATE:
{
SetTimer(hwnd, IDT_TIMER1, 500, NULL);
SetTimer(hwnd, IDT_TIMER2, 500, NULL);
SetTimer(hwnd, IDT_TIMER3, 500, NULL);
.............
.............
.............
case WM_TIMER:
{
test++;
switch (wParam)
{
case IDT_TIMER1:
{
test1++;
InvalidateRect(hwnd, NULL, FALSE);
return 0;
}
case IDT_TIMER2:
{
test2++;
InvalidateRect(hwnd, NULL, FALSE);
return 0;
}
case IDT_TIMER3:
{
test3++;
InvalidateRect(hwnd, NULL, FALSE);
return 0;
}
}
}
Within WM_PAINT, i displayed test, test1, test2, & test3 respectively....
Code:
sprintf(text, "%d %d %d %d", test, test1, test2, test3);
TextOut(hdc, 10, 10, text, (int)_tcslen(text));
To my surprise, the output is as follows
Code:
0 0 0 0
3 1 1 1
6 2 2 2
9 3 3 3
12 4 4 4
......
......
// etc.
This means all three timers are only executed for every third call of WM_TIMER