Is there a way to use more than one timer in a windows program through WM_TIMER in WndProc?
Is there a way to use more than one timer in a windows program through WM_TIMER in WndProc?
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
yes give them different ids.
Last edited by Stoned_Coder; 02-28-2003 at 08:02 PM.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Could you give me an example of this?
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
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; }
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Ok, thanks. I just wasn't sure what to put under WM_TIMER...
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
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...
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared