VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Shuts Down, Logs Off or Reboots a machine in easy code.

by The Spud Man (1 Submission)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 14th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Shuts Down, Logs Off or Reboots a machine in easy code.

API Declarations


Private Declare Function ExitWindowsEx Lib "user32" (Byval uFlags as Long, byval dwreserved as Long)
Private Const FORCE& = 4
Private Const LOGOFF& = 0
Private Const REBOOT& = 2
Private Const SHUTDOWN& = 1
#endif 'WIN32
Private Sub Form_Click
Call ExitWindowsEx(Shutdown Or Force, 0)
'Replace Shutdown with Force or Logoff if wanted
End Sub


Rate Shuts Down, Logs Off or Reboots a machine in easy code.



Private Sub Form_Click
Call ExitWindowsEx(Shutdown Or Force, 0) 
'Replace Shutdown with Force or Logoff if wanted
End Sub


Download this snippet    Add to My Saved Code

Shuts Down, Logs Off or Reboots a machine in easy code. Comments

No comments have been posted about Shuts Down, Logs Off or Reboots a machine in easy code.. Why not be the first to post a comment about Shuts Down, Logs Off or Reboots a machine in easy code..

Post your comment

Subject:
Message:
0/1000 characters