Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for user inactivity
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00416541
Message ID:
00421095
Views:
18
>I have an application which needs to keep track of the time for which its been idle, ie no user interaction. How do I do this in VFP??
>Thanks!

Ashish,
Maybe this will help: I set two global variables cSTART and cValueNow, and provide about a minute countdown before termination.

*Main.prg
cSTART= SYS(2)
DO MENUTOOL.MPR
DO Form NTABTOOL
READ EVENT
*Button Pressed
cSTART= SYS(2)
thisformset.Forms(1).timer1.Interval= 100000 && Reference MainForm Timer
*** MAIN FORM TIMER1.TIMER FOR 1 hour inactivity SHUTDOWN TIME ADD EXTERNAL LOOP LIMIT TO MESS
cValueNow= SYS(2)
if Val(cValueNow) - Val(cSTART) > 3600
This.Interval= 1111
wait window nowait "Application will Shutdown in - "+ STR(3701-(Val(cValueNow) - Val(cSTART)))+ " seconds!"
if Val(cValueNow) - Val(cSTART) > 3700
This.Interval= 0
DO Xit
endif
endif
Edgar L. Bolton, B.S. B.B.A.
Previous
Reply
Map
View

Click here to load this message in the networking platform