Re: Rebooting to safemode

Posted by Filip on May 30, 2006

In Reply to Rebooting to safemode posted by Smit on May 17, 2006

Does anyone know how to reboot the computer from delphi, rebooting into safe mode would be a bonus.

To shut down Windows and then restart:
ExitWindowsEx(EWX_REBOOT, 0);

To shut down Windows and turn off the power:
ExitWindowsEx(EWX_POWEROFF, 0);

To shut down the system when it is safe to turn off the power, after all file buffers have been flushed to disk, and all running processes have stopped:
ExitWindowsEx(EWX_SHUTDOWN, 0);

To force applications to terminate even if they don't respond, instead of bringing up the "application not responding" dialog:
ExitWindowsEx(EWX_FORCE, 0);

Related Articles and Replies





DelphiLand Club members: enter your Membership password.
Guests can get a Forum Guest password by subscribing to the DelphiLand Newsletter.