|
|
Clarion Language and Runtime Library
Started by z80jim at 05-01-2008 6:17 AM. Topic has 4 replies.
 
 
|
|
Sort Posts:
|
|
|
|
05-01-2008, 6:17 AM
|
z80jim
Joined on 12-16-2005
Posts 14
|
Automatically Close window on no activity
|
|
|
|
|
I write my Clarion applications by hand. There are certain windows that users leave open that I would like to time out and close automatically after a certain amount of no activity.
Does anyone have any suggestions?
Regards,
Jim
|
|
|
|
|
Report
|
|
|
|
05-01-2008, 11:23 AM
|
Shankar
Joined on 10-24-2005
Dubai, UAE
Posts 219
|
Re: Automatically Close window on no activity
|
|
|
|
|
Hi Jim,
There must certain APIs you can use to find out the time elapsed since the last keystroke or mouse movement but the easier approach is to invest in vuFileTools from www.valutilities.com which has a function for just that. You could also try out the IDLE([procedure] [,separation]) function in Clarion. Check the help for more info.
Regards
Shankar
|
|
|
|
|
Report
|
|
|
|
05-02-2008, 6:17 AM
|
Russ
Joined on 10-20-2005
Posts 223
|
Re: Automatically Close window on no activity
|
|
|
|
|
Put a timer on the window and if a mouse event or key press, set the count value to zero. When count value => limit value, then POST(EVENT:CloseWindow).
That is the rough idea, the code should not be difficult to write.
Russ Eggen www.radfusion.com
|
|
|
|
|
Report
|
|
|
|
05-02-2008, 7:16 AM
|
z80jim
Joined on 12-16-2005
Posts 14
|
Re: Automatically Close window on no activity
|
|
|
|
|
Russ,
Sounds good. I thought about the timer event since I use them in a number of places but I completely blanked on trapping for a key or mouse.
I will have to play around with it.
Thanks
|
|
|
|
|
Report
|
|
|
|
05-02-2008, 2:31 PM
|
Tony Tetley

Joined on 10-25-2005
Missouri, USA
Posts 80
|
Re: Automatically Close window on no activity
|
|
|
|
|
If you want to roll your own, look at the GetLastInputInfo API call (user32.dll). Not supported prior to Win 2000 I think.
Tony
|
|
|
|
|
Report
|
|
|
|
|
|