Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to have time out in VFP? 5

Status
Not open for further replies.

Mandy_crw

Programmer
Jul 23, 2020
578
PH
Hi everyone... I dont know how to ask the question well but is it possible for VFP to do something else when its idle? like in windows, it has a screensaver to show when computer has no activity... I want my app that when it's idle for sometime, it will show something or do something... thanks in advance...
 
Mike,

I see why you wouldn't take moving the mouse as activity. And I can imagine a case where your own application window is just between two others so if there is a drag operation between those two windows crossing yours this is seen as activity in your application. The way I work with Desktop Window docking this would be a rare case. What's perhaps cleverer about just checking the clicks of mouse buttons is that they are not as often as moves and so there's less calls of VFP code. It doesn't really spare the many move events, as they happen anyway, and also trigger events in VFP windows and controls anyway.

I already noticed and mentioned Tamars solution also allows excluding some actions from application activity. It also depends on what exactly you'd like to do when the application considers to be idle. It shouldn't be that important that you hope for the idle state to happen often, i.e. your application should work well without any actions necessary when it idles. I know sporadically people mention problems with Windows suspending into sleep mode.

If it's all about shutting down an application for too long inactivity to ensure no user hinders exclusive DBC access or something like that, you also don't need the reactivation part. And in that case I actually only want to shut down when the user really went off without closing applications and shutting down Windows. So any sign of a user still there, even just a move over one of my windows, is welcome as sign that's not yet the case.

Chriss
 
Hello all,

I have recently returned to primary support of the apps/tools I developed over the past 20+ years - all predominately VPF 8/9. My company makes a lot of use of Remote Desktop Services/Servers and I have a real issue with users logging into the RDS, getting into my application, then disconnecting, leaving the application active and tables open. This leads to the inability to run nightly jobs that require exclusive access (reindexing being the predominate one).

Looking for ideas, I took a shot on the old Tek-Tips forum, figuring it would probably return a 404. Whelp, I cannot believe the site is not only still alive, but reading through these post is like seeing old friends again.

So I would like to say hello and offer a thank you to all the folks posting in this thread - these ideas are just what I was looking for.

I apologize not being exactly on topic and I hope you all will forgive my bad manners.
MSC
 
FWIW, I chose KeyPress and MouseMove to make it work the way a screensaver does. Any user action hides the screensaver.

But I can see why MouseMove might be overkill. Depends on the situation.

Tamar
 
Thanks Tamar and Myearwood... i dont know what is maxframe myearwood sorry... but im willing to learn also... God bless
 
i dont know what is maxframe myearwood sorry... but im willing to learn also

Mandy, you might remember that we had a discussion about using Maxframe in an earlier thread (thread184-1814526, around middle of April).

I explained that Maxframe (or Visual Maxframe, to give it its proper name) is an "application framework", that is, a set of classes and other components that work together to form the basis of an application. In general, frameworks handle most or all the underlying processing that tends to be common among applications: things like general data entry forms, report selection forms, error handling, database admin, and so on, leaving you free to handle the bits that are specific to your project. (I'm simplifying the explanation, but I hope it gives you the general idea.) The point is that a well-designed framework can do a great deal to simplify the development of a large or complex application.

However, there are two major caveats:

- Frameworks tend to require a substantial investment in learning time; and

- It is rarely possible to implement a framework retrospectively. You really need to plan the entire application around it, from the ground up.

I stress that this is absolutely no criticism of Visual Maxframe or any other framework. But they are points that you need to keep in mind.

I know that you have already put a lot of effort in learning FoxPro, and that your application is nearly finished. You have clearly done a great job in both areas. My advice would be to continue on that same path. Continue to improve the application, and to improve your knowledge as you do so. If you ever start a new project from scratch, you might consider using a framework, but until then, don't get distracted along that road.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top