Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer - How to
Message
 
 
À
13/10/2000 09:28:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00428999
Message ID:
00429006
Vues:
21
The best way is to make new class based on timer. Than add it in run-time to any object that is global and exists all the time application runs. In your case this may be main top-level form. If modal form opened - this is not a problem, timer event will fire anyway.

Than, in your class in timer event check datetime() and shutdown application. Be sure no errors during forcing of form close, and no 'table open' dialog boxes appear because thay will prevent automatic shutdown requiring user interaction. When some form have data unsaved, that form should not show dialog boxes, so you will need a way to indicate that you're in shutdown mode. I usually use global logical variable flag for that. When it is .T., I avoid any dialog boxes and revert any changes in tables.

Only cases when timer event will not fire - Windows Open dialog boxes (like file selection by GetFile(), color selection by GetColor, diirecory selection by GetDir() etc.) It aso will not work whan application hangs up.

As you see, this task is not so easy. In one of my applications I made 'companion' Windows application, that tries to shutdown any VFP applications on computer at special time. When some application failed to shutdown because dialog boxes, that application will be killed as Windows process to free resources anyway.

>I have never use a timer contol before.
>
>I would like to use a timer control in my app that would allow me to quit the app after say 11:30pm reguardless where in the app that the user left (when home) it on the screen.
>
>All files are read only (no updates allowed).
>
>What would be the timer control steps to accomplish this?
>
>Main Form is modeless rest forms modal.
>
>Thanks in advance!
>Roland...
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform