Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quit program and restart it automatically
Message
De
09/02/2008 14:14:01
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01291083
Message ID:
01291096
Vues:
11
>Isn't there a way, perhaps using a Windows API, to exit a program and tell Windows to immediately restart it?

You can call your own exe again using shellexecute() and then quit the current one, but the timing may be bad - if your app does a lot of housekeeping on exit, the new instance may already be half loaded while the old one exits.

You may try to use Windows scheduler and make the app run in a couple of seconds - run the scheduler via its API or as another shellexecute() call - and make this the last thing your app does in your On("shutdown") code, i.e. after you've closed all tables, released all forms, killed all nasty timers you hid in the attic, released all the libraries you kept in the dungeons etc.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform