Does it only suspend the system or i can use it for reboot also?
Which function do they use installation programs for rebooting the system ?
Does it only suspend the system or i can use it for reboot also?
Which function do they use installation programs for rebooting the system ?
Use ExitWindowsEx or InitiateSystemShutdown. You will need to enable the SE_SHUTDOWN_NAME privilege. You can use my EnableProcessPrivilege function. Rebooting should always be optional.
Originally Posted by anonytmouse
Good Work! But i want also my process to be restored after reboot,and the context to be the same as it was before reboot...is it possible?
Setup programs do it
Last edited by Lionel; 05-29-2005 at 02:49 PM.
??
How do setup programs reboot the system and automatically restore their execution just where they were before rebooting??
You can have your program start after the reboot by adding it to the RunOnce registry key. Context will not be restored automatically but you can use a command line option to indicate to your program to start at a specific point.
Example:
Code:// Command line: C:\\mypath\\myprogram.exe /afterreboot // At program start: if (strstr(lpCmdLine, "/afterreboot") != NULL) { // goto to after reboot stage } else { // goto beginning }