Displaying the "Shut Down Windows" dialog

Submitted by:Andery Smith

Date added:05 April, 2011

Category:Visual Basic

'The following code snippet displays the "Shut Down Windows" dialog.
'Is uses undocumented API function in shell32.dll

Tags: displays shut down windows dialog

Code Snippet:

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

Private Sub cmdShowShutDown_Click()
ShutDownDialog hWnd
End Sub