VB Code:
  1. Private Const EWX_SHUTDOWN As Long = 1
  2. Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
  3.  
  4. lngResult = ExitWindowsEx(EWX_SHUTDOWN, 0&)