PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: John Montenigro on December 05, 2009, 02:13:42 AM

Title: KillTimer
Post by: John Montenigro on December 05, 2009, 02:13:42 AM
I wanted to check the syntax for KillTimer, but couldn't find the details in the Function Library... Did I just not find it, or is it not there?

I'm still testing, but I'm not sure this is right:
  KillTimer HWND_FRMMAIN, IDC_FRMMAIN_TIMER2     

-John
Title: Re: KillTimer
Post by: Rolf Brandt on December 05, 2009, 05:20:55 AM
That syntax is absolutely correct, John.
Title: Re: KillTimer
Post by: John Montenigro on December 05, 2009, 04:48:47 PM
Thanks, Rolf!

Is there an entry in the Funtion Library? Where?
Title: Re: KillTimer
Post by: José Roca on December 05, 2009, 05:13:15 PM
No. It's a Windows API function, not a FF function.
Title: Re: KillTimer
Post by: John Montenigro on December 05, 2009, 05:30:42 PM
doh!  :o   

Thanks for the guidance, Jose!


OK, so here's the problem:
App starts with a splash screen and a check for registration.
If not registered, Timer2 gets set for a 2-minute shutdown, and the app continues to work for that time. (It's a small utility and that's more than enough time to see how it works...) When time is up, it goes to ShutDown.
If it IS registered, Timer2 gets killed and the app continues to work, and it should be without time limit. However, I'm seeing the app shutdown...

So at least I know I'm killing the timer correctly.

BUT, KillTimer's description mentions:
Remarks
The KillTimer function does not remove WM_TIMER messages already posted to the message queue.

So if it takes the user more than Timer2's timeout time to get past the splash screen, it's possible that a trigger message was already generated, so even though the app is registered, there could be a Kill message waiting...

But if the timer is killed in-between, how could a pending message have any effect at all??

(I'm going to try changing where I give the timer its Start message...)

We shall see what happens...Stay tuned (but I won't be back online till late tomorrow, so don't hold your breath!)  (Shhh, don't tell Paul, but I'm going to be watching the Pats trounc...er...play the Dolphins.)