KillTimer

Started by John Montenigro, December 05, 2009, 02:13:42 AM

Previous topic - Next topic

John Montenigro

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

Rolf Brandt

That syntax is absolutely correct, John.
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

John Montenigro

Thanks, Rolf!

Is there an entry in the Funtion Library? Where?

José Roca

No. It's a Windows API function, not a FF function.

John Montenigro

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.)