Results 1 to 4 of 4

Thread: Why deosn"t this code work?

  1. #1
    vbGrandpa
    Guest

    Why deosn"t this code work?

    I am using the following code in a procedure:

    Public Const EWX_LOGOFF = 0
    Public Const EWX_SHUTDOWN = 1
    Public Const EWX_REBOOT = 2
    Public Const EWX_FORCE = 4

    Declare Function ExitWindowsEx Lib "user32" _
    (ByVal uFlags As Long, ByVal dwReserved _
    As Long) As Long

    'If you wanted to forcefully reboot the computer use the following code:

    't& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)


    LOGOFF works great but EWX_FORCE Or EWX_REBOOT doesn't
    ?????????????????????????????????

    Thanks
    Grandpa

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Are you using NT/2000? You need to adjust the security token to shutdown. See http://www.allapi.net/ for an example.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4
    vbGrandpa
    Guest
    Thanx Josh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width