How to force "it's now safe to turn off your computer" screen in Windows XP when shutting down?
c++
Solution
After two days of searching, I finally solved it, well actually a colleague of mine :-) !
Read this article for the details: https://web.archive.org/web/20140209015215/http://support.microsoft.com/kb/819760
Essentially it comes down to running:
reg add HKLM\Software\Policies\Microsoft\Windows NT /v DontPowerOffAfterShutdown /t REG_DWORD /d 1 /f
And then calling `ExitWindowsEx` with option `EWX_SHUTDOWN` from my application.
Problem
I'm looking for a way to force Windows XP Pro SP3 to display the 'It's now safe to turn off your computer' screen when doing a shutdown. The reason behind is that I want my UPS to turn off/on the power at some point and the PC should startup automatically again after the power cycle. In the BIOS this can be configured so that the PC powers on automatically if it sees power is being restored, but only if the PC was running before the power went away initially. It seems it was possible to force this in Windows XP < SP1 by calling `ExitWindowsEx` with the `EWX_SHUTDOWN` uFlags parameter See here for details So why was this removed in SP1 and higher? Any other ways to force this?