Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto close feature
Message
From
21/04/2005 02:46:47
Somesh Sahu
Cybage Software Pvt Ltd,
Pune, India
 
 
To
10/02/2005 10:35:43
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
00977685
Message ID:
01006845
Views:
40
Hi Jos,
How are you?
I successfully implemented the Auto closure feature :-). Your suggestions helped me a lot. Thanks for your guidance. Hope in future we will have more discussions.
Are you working as a professional Software Developer or running your own company?

Regards,
Somesh

>Hi Somesh. Don't put the timer on the form. Create a timer object. Or subclass it and add your own properties to hold the coordinates and last time. Make the timer object a global variable then it is available everywhere. Or add the timer object to the system object. I think that will solve it for you.
>
>The error occurs because you are referencing THISFORM.some_propery but that object is not the object when another form is active. As a globally accesible object not tied to the current form you will not have this problem.
>
>
>>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