[This function is available through Windows XP Service Pack 2 (SP2) and Windows Server 2003. It might be altered or unavailable in subsequent versions of Windows.]
Displays a dialog box that asks the user to restart Windows. When the user clicks the button, the function calls ExitWindowsEx to attempt to restart Windows.
int RestartDialogEx( HWND hwnd, PCWSTR pszPrompt, DWORD dwReturn, DWORD dwReasonCode );
A handle to the parent window.
A null-terminated string that contains the text that displays in the dialog box to prompt the user.
The flags that specify the type of shutdown.
This parameter must include one of the following values.
Shuts down all processes running in the security context of the process that called this function. Then logs the user off.
Shuts down the system and turns off the power. The system must support the power-off feature. The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see ExitWindowsEx.
Shuts down the system and then restarts the system. The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see ExitWindowsEx.
Shuts down the system to a point at which it is safe to turn off the power. At this point, all file buffers have been flushed to disk, and all running processes have stopped. If the system supports the power-off feature, the power is also turned off. The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see ExitWindowsEx.
This parameter can optionally include the following values.
Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.
Windows XP:Specifies the reason for initiating the shutdown. For more information, see System Shutdown Reason Codes.
Windows 2000: This parameter is ignored.
Returns the identifier of the button that was pressed to close the dialog box.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Header||shlobj_core.h (include Shlobj.h)|
|DLL||Shell32.dll (version 5.0 or later)|