Is there a way to use more than one timer in a windows program through WM_TIMER in WndProc?
Printable View
Is there a way to use more than one timer in a windows program through WM_TIMER in WndProc?
yes give them different ids.
Could you give me an example of this?
Look its not too hard.
Just like that.Code:In WM_CREATE ....
SetTimer(hwnd,IDT_T1,5000,(TIMERPROC)NULL);
SetTimer(hwnd,IDT_T2,1000,(TIMERPROC)NULL);
in WM_TIMER.....
case WM_TIMER:
switch(wParam)
{
case: IDT_T1: // do stuff every 5 secs.
break;
case: IDT_T2: // do stuff every second.
break;
}
Ok, thanks. I just wasn't sure what to put under WM_TIMER...
Check out my game! It's sorta incomplete, but it works and it's the first one I've made. Let me know what you think and if there are any major problems.
Oh, and if it seems familiar to you then...it probably is...