As the title says.
I can't seem to find anything on MSDN on this subject.
The timers being used aren't HANDLE variables; rather, they are declared like #define IDT_TIMER 100.
Thanks!
Printable View
As the title says.
I can't seem to find anything on MSDN on this subject.
The timers being used aren't HANDLE variables; rather, they are declared like #define IDT_TIMER 100.
Thanks!
What do you mean by "How to test"? :confused:
Just set a breakpoint and/or use TRACE and debug!
And how IDT_TIMER 100 is used?
You don't need resources to use a timer... you can simply use settimer/killtimer.Quote:
#define IDT_TIMER 100
Sorry, I guess I should have been more clear!
I want to programmatically, at some point in the code, test if a certain timer has been killed. If so, I want to do nothing. Otherwise, do something.
IDT_TIMER is used like: SetTimer(hWnd, IDT_TIMER);
You could always maintain a flag that you set to true when you start the timer and false when you kill it.
whoops, sorry, I meant to write KillTimer, not SetTimer!
Well, it's kind of complicated to explain why I need to do this, but I'll try my best.
I'm working on code that is basically video calls over IP. When Phone A calls Phone B, Phone A starts a timer for the time they have to wait for a person to answer. Phone B, upon receiving the request, has a timer that starts for the time they have to answer the call before the call will time out.
These timers should be for the same length, but there is a little bit of delay related to the time it takes for one phone to even realize that another phone is calling it.
So, sometimes, Phone B will be able answer even when Phone A's timer has been killed, and weird stuff happens.
Therefore, I want Phone A to be able to test if its timer has been killed before a call starts. If it's been killed, ignore the call. If not, proceed as normal.
If there really is not way to see if a timer has been stopped, I'll probably go with a flag, thanks :) It's just kind of a pain in the butt with the way the code is set up.
There really isn't any Win32 api to do it. I suppose if you know the original SetTimer parameters for the ID that you would like to check, then you could call KillTimer and look for a successful return value. If KillTimer returns a success, then you know the timer was running and you can use the parameters to restart the timer. Of course that would interupt the current timer interval and could be up to a bit more than twice the regular interval.