CriticalReboot method
The CriticalReboot method forcefully closes all interactive applications and initiates a restart of a computer.
Syntax
HRESULT CriticalReboot(
[in] LONG TimeOutInSeconds
);
Parameters
TimeOutInSeconds [in]
The amount of time, in seconds, that the Shut Down dialog box is displayed. While the Shut Down dialog box is displayed, the shut down request can be stopped by using the Console::AbortShutdown method.Note In Windows Server 2003 and Windows XP with Service Pack 1 (SP1), the value of this parameter cannot be larger than MAX_SHUTDOWN_TIMEOUT seconds.
Return value
The CriticalReboot method returns a standard HRESULT.
Remarks
Unlike the Console::Reboot method, the CriticalReboot method automatically closes applications before it initiates a system shutdown.
If the TimeOutInSeconds parameter is not zero, the CriticalReboot method displays a dialog box on the computer. The dialog box beeps when it is created and remains on top of other windows in the system. The dialog box prompts the user to log off, and can be moved but not closed. A timer counts down the remaining time before the system is restarted.
If TimeOutInSeconds is zero, the computer restarts without displaying the dialog box, and the restart cannot be stopped by the Console::AbortShutdown method.
To use the CriticalReboot method, the caller should be running on the interactive console.
Note If you use this method, you might lose work when applications are automatically closed.
See also
Send comments about this topic to Microsoft
Build date: 1/12/2012