Results 1 to 2 of 2

Thread: InitiateSystemShutDown in W95/8 net?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350
    I would like to turn off any of computers located in my network. The problem is, they are running W95. Is there any API functions like WinNT API?

    ------------
    Thanks,
    Johnny (69680 sec. to 15th birthday!)

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I don't know about how to use this with the network, but this is the code for how to shutdown/restart or suspend:


    Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
    Private Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Long, ByVal fForce As Long) As Long
    Enum exitmode
    Shutdown = 0
    Restart = 1
    Suspend = 2
    End Enum

    Sub ExitWindows(how As exitmode)
    Select Case how
    Case 0
    t& = ExitWindowsEx(1, 0)
    Case 1
    t& = ExitWindowsEx(2 Or 4, 0)
    Case 2
    SetSystemPowerState 1, 1
    Case Else
    MsgBox "Invalid exitmode calling ExitWindows... Try to use your brain or VB!"
    End Select
    End Sub

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