SurvivorTiger,
OK...ok I think that is too difficult right but the trick here is to copy this part to a Module in your VB project...
called it Module1.bas
'Api function and the constants required for ExitWindowsEx
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, _
ByVal dwReserved As Long)
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1
Then Create a Form let say form1.frm and copy this code with a button name cmdShutdown.....
Private Sub cmdShutdown_Click()
Dim MsgRes As Long
'Make sure that the user really want to shutdown
MsgRes = MsgBox("Are you sure you want to Shut Down Windows 95?", vbYesNo Or vbQuestion)
'If the user selects no, exit this sub
If MsgRes = vbNo Then Exit Sub
'else, shutdown windows and unload this form
Call ExitWindowsEx(EWX_SHUTDOWN, 0)
Unload Me
End Sub
If the above code still doesnt work for you because its API then forget about Win API.... i suggest you use this simple code.
Private Sub cmdShutdown_Click()
Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}"

.ExecQuery("Select * from Win32_OperatingSystem"

For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next
End Sub
![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)
AYh8DisJob
"God can turn any difficulty into an opportunity."