Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quit program and restart it automatically
Message
From
09/02/2008 14:14:01
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01291083
Message ID:
01291096
Views:
10
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform