Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto close feature
Message
From
10/02/2005 09:24:58
Somesh Sahu
Cybage Software Pvt Ltd,
Pune, India
 
 
To
17/01/2005 06:06:56
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
00977685
Message ID:
00985542
Views:
35
Hi,
For the Auto Closure feature in the Application, I am using a Timer Control on the 'Main Form (which remains open for enitre session of the application)'. This timer checks the Inactivity of the User at the Time Interval and closes all the open forms and then quits from the application. It works fine with the forms but does not work when a report is in Print Preview mode or any Menu is Open and User is idle for Auto Closure time. It gives error 'Activeform is not an Object'.

The code in the Timer event of the Timer Control is as follows -
IF MROW("SCREEN",3) == THISFORM.Last_MouseRow AND MCOL("SCREEN",3) == ; THISFORM.Last_MouseCol AND THISFORM.Last_Key == LASTKEY()

IF NOT ExitApp(.F.)
NODEFAULT
ENDIF

ENDIF
THISFORM.Last_MouseRow = MROW("SCREEN",3)
THISFORM.Last_MouseCol = MCOL("SCREEN",3)
THISFORM.Last_Key = LASTKEY()

Whenever Mouse is moved or any key is pressed, Last_MouseRow, Last_MouseCol and Last_Key properties are changed.If no change is find, then 'ExitApp' function closes all the forms and quits the application.
Please tell me how to overcome this problem.

Regards,
Somesh

>>Hi,
>> Is it be possible to have an auto close feature in an application so that if a user does not access the application for say 30 minutes, the user gets logged out?
>>
>> If yes, please tell how to implement this.
>>
>>Thanx and regards,
>
>Hi Somesh.
>
>A simple approach to this is to create a custom timer class. The custom timer should have additional properties to store the last mouse x,y position and the last time the user did something. Then at the start of your app create the custom timer and have it run once every few minutes or whatever.
>
>The timers event code would test to see if the mouse has moved since the last call to the timer event. If the mouse has moved then save the current mouse x,y position, and save the current time. If nothing has changed then see if the current time is more than, say, 30 minutes past the last time something changed. Take action as appropiate.
>
>This does not test for keyboard activity but how likely is it that the user never touches the mouse in 30 minutes in your app? You could also test for keyboard activity if you feel you need to.
>
>Also check out threads like this one: Auto Logout Thread #92027
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform