>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.