ExitWindowsDialog Function

Declare Sub ExitWindowsDialog Lib "shell32.dll" Alias "#60" (ByVal hwndOwner As Long)

Platforms

The ExitWindowsDialog function is officially undocumented.

Description & Usage

ExitWindowsDialog prompts the user with the "Shut Down Windows" dialog box. This is the same box as the one that appears when the user selects "Shut Down" from the Start menu. Unfortunately, there is no way to know what the user chose in the dialog box, or if the user simply cancelled it. Unlike most API dialogs, this function actually begins the shut down, reboot, or whatever other process the user selected.

Return Value

This function does not return a value.

Visual Basic-Specific Issues

None.

Parameters

hwndOwner
A handle to the window that is opening the Shut Down dialog box.

Example

' This code is licensed according to the terms and conditions listed here.

' Declarations and such needed for the example:
' (Copy them to the (declarations) section of a module.)
Public Declare Sub ExitWindowsDialog Lib "shell32.dll" Alias "#60" (ByVal hwndOwner As Long)

' When the user clicks button Command1 on window Form1, display the
' Shut Down Windows dialog box.
Private Sub Command1_Click()
	ExitWindowsDialog Form1.hWnd
	' That's all it takes!
End Sub

See Also

RestartDialog

Category

Shell

Back to the Function list.
Back to the Reference section.


Last Modified: July 4, 2000
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/e/exitwindowsdialog.html