Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Auto Close a form?
Message
From
25/01/2009 10:50:04
 
 
To
25/01/2009 06:28:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01376662
Message ID:
01376868
Views:
15
Greg,

I stated I was using it in VPM and that is the framework I use for all of my applications but it was a typo, as I am doing all of my testing in just plain VFP9 in the IDE. From all my testing, it appears that MROW() and MCOL() pick up mouse moves any where on the desktop and other applications. This seems strange to me since this is VFP command. I would have thought it would only pick up mouse movement over a VFP application but the line of code: WAIT WINDOW NOWAIT "Resetting "+lcPos fires anytime I move the mouse over any application and even while just over the Desktop.

I can get it to just fire when just over the form by putting code in the thisform.form1.mousemove event and I figure I should be able to do the same thing for the entire application by putting code in the _SCREEN.mousemove event but I don't know how access the _SCREEN.mousemove event and add code to this method.

Also, I just found some code where someone has used the ON KEL LABEL MOUSE command to contol exiting a form and this looks promising as it only responds to the VFP application window. It doesn't track mouse movement but it does respond to mouse clicks and that should be O.K. for what I'm trying to do.

Sorry to be so "dumb" about this but this is the first time I have found the need to track mouse movements so it's virgin territory for me.

Thanks,
Robert


>Thanks for the feedback. When time permits I will look into it. As for the VPM part, I don't have a version of VPM to test with. But >hould be able to find a workaround.
>
>Greg (and Naomi),
>
>Thanks. I got the error to go away once I realized it was related to just the name of the form/control being included in the WAIT WINDOW box. However, I now also understand that this class tracks mouse movement anywhere on the screen, even if another application has focus. Is there a way to only have the mouse movement be seen by the timer only if they are over the VPM application when it has focus?
>
>TIA,
>Robert
>
>>See Naomi response.
>
>>Greg,
>>
>>I downloaded your class and it seems to be exactly what I am looking for (Thanks!). However, I am sometimes getting the following error:
>>
>>"Member ACTIVECONTROL does not evaluate to an object" The debugger opens at the following line of code:
>>
>>
>
>>
>>lcPos = TRANSFORM(lnCursorX)+","+TRANSFORM(lnCursorY) ;
>> +","+TRANSFORM(MROW("",3))+","+TRANSFORM(MCOL("",3));
>> +","+transform(_vfp.ActiveForm.Name) ;
>> +","+TRANSFORM(_vfp.ActiveForm.ActiveControl.Name)
>
>>
>>This error only seems to occur only when I return to the VFP9 after working in another application window for a while. If the VFP program remains the active application, I don't seem to see the error. Have you got any idea how I can eliminate this error?
>>
>>TIA,
>>Robert
>>
>>
>>>>I need to automatically close forms if they have been open for X minutes without any user activity.
>>>>
>>>>Does anyone know if someone has created a Class or program that will handle this.
>>>>
>>>>Thanks,
>>>>
>>>>Robert
>>
>>>Here is a little diddy that I through together a while ago. "Auto-close a form after N second of inactivity" download #28400.
Greg Reichert
GLR Software - www.GLRsoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform