PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: I feel silly asking this...  (Read 238 times)

BudDurland

  • Guest
I feel silly asking this...
« on: January 29, 2008, 12:46:11 PM »

On an application that I wrote here at work, I added a timer to the main (only) form.  Basically, the timer checks for user activity based on a global flag.  When no activity happens for 2 passes of the timer (about 20 minutes), I do an FF_CLOSEFORM.  Since there is only one form, I expected this would close the program.  I've seen a couple of instances where the form was closed, but the executable stayed in memory.  This program generates reports.  Clicking the button to make a report resets the activity flag, and none of the reports take longer than 60 seconds or so to make.  Is there a better approach to ending the program via code?
Logged

TechSupport

  • Guest
Re: I feel silly asking this...
« Reply #1 on: January 29, 2008, 07:26:13 PM »

Not sure why the exe would stay in memory because the logic that you're using seems okay to me.

Just thinking out loud.... maybe closing the Form from within the Timer event is causing a problem? If that is a cause then maybe you can PostMessage a user defined message to the Main Form and then respond to that message in the CUSTOM message handler of the main form by issuing an FF_CloseForm. It's worth a try. :)



Logged

Mark Strickland

  • Guest
Re: I feel silly asking this...
« Reply #2 on: January 31, 2008, 06:24:22 PM »

I remember a problem with a form and a timer that was closing the form.   I have not looked up the details yet but I had to do an API call to kill the timer in the form destroy.

Might be worth exploring.

Logged