In a windows project I am working on, I intend to have a menu selection that copletely restarts the app. Is there a Windows or C++ function that does this?
ExitWindowsEx is what you want. You can also run the shutdown.exe utility built into windows.
shutdown -t0 -r (restart the system after 0 seconds)
There isn't a built-in for this, but a well-designed application can simply stop everything that's going on and then loop back to the start. If you want a true 'fresh start', you will have to spawn a new process (possibly as the last thing you do before the old one shuts down.)
No, you must do it yourself. For instance, you can run external process which will wait until you exit your application, and then run it again.
Already needed to do this. The easiest way without any further reading would be to write a simple .bat-file (either by hand or dynamically by your application) starting your program and then calling that bat-file from your application.
The bat-file may even contain a line to remove itself after having started your app...
You want to call CreateProcess and then close your current instance of the application gracefully with ExitProcess(), or if you link to the C runtime, just return from main(). But first you should ask yourself why you need to recreate the process in the first place.
Actually you might want to take a look at the Restart Manager API that came in with Windows Vista. As ever you can p-invoke this to your hearts content and theirs explicit support coming for it in Visual C++ 2010.