From: Randy Birch on
Try this:

Private Declare Function ExitWindowsDialog Lib "shell32" _
Alias "#60" _
(ByVal hwndOwner As Long) As Long

Private Sub Command1_Click()
Call ExitWindowsDialog(Me.hWnd)
End Sub

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.




"Jeff Johnson [MVP: VB]" <i.get(a)enough.spam> wrote in message
news:eDKTkXkMGHA.2696(a)TK2MSFTNGP14.phx.gbl...
:
: "J French" <erewhon(a)nowhere.uk> wrote in message
: news:43f2ff12.255741948(a)news.btopenworld.com...
:
: >>What is the call to display the Windoes shutdown dialog box (as if i
: >>pressed shutdown on the Start menu)
: >
: > ExitWindowsEx
: >
: > See the two examples for 9x and NT/XP in the downloadable API Guide
: >
: > http://www.mentalis.org/agnet/
:
: I see nothing in the documentation of ExitWindowsEx() that suggests it can
: display the shutdown dialog box.
:
:

From: Randy Birch on
.... or for script kiddies ...

Private Sub Command4_Click()

Dim objShell

Set objShell = CreateObject("Shell.Application")
objShell.ShutdownWindows

Set objShell = Nothing

End Sub



--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.




"Randy Birch" <rgb_removethis(a)mvps.org> wrote in message
news:OR2z%23GpMGHA.1028(a)TK2MSFTNGP11.phx.gbl...
: Try this:
:
: Private Declare Function ExitWindowsDialog Lib "shell32" _
: Alias "#60" _
: (ByVal hwndOwner As Long) As Long
:
: Private Sub Command1_Click()
: Call ExitWindowsDialog(Me.hWnd)
: End Sub
:
: --
:
: Randy Birch
: MS MVP Visual Basic
: http://vbnet.mvps.org/
:
: Please reply to the newsgroups so all can participate.
:
:
:
:
: "Jeff Johnson [MVP: VB]" <i.get(a)enough.spam> wrote in message
: news:eDKTkXkMGHA.2696(a)TK2MSFTNGP14.phx.gbl...
::
:: "J French" <erewhon(a)nowhere.uk> wrote in message
:: news:43f2ff12.255741948(a)news.btopenworld.com...
::
:: >>What is the call to display the Windoes shutdown dialog box (as if i
:: >>pressed shutdown on the Start menu)
:: >
:: > ExitWindowsEx
:: >
:: > See the two examples for 9x and NT/XP in the downloadable API Guide
:: >
:: > http://www.mentalis.org/agnet/
::
:: I see nothing in the documentation of ExitWindowsEx() that suggests it
can
:: display the shutdown dialog box.
::
::
:

First  |  Prev  | 
Pages: 1 2
Prev: SetTimer vs. Timer Control
Next: Shellexecute in VB6