1 Replies - 1215 Views - Last Post: 03 January 2011 - 07:36 AM Rate Topic: -----

#1 meetliju2010  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-January 11

VB ExitWindows NOT WORKING

Posted 03 January 2011 - 07:29 AM

USING WINDOWS XP, VB 6
THE FOLLOWING CODE IS NOT WORKING
' SHUT DOWN AND RESTART IN VB6
Const EWX_LogOff As Long = 0
Const EWX_SHUTDOWN As Long = 1
Const EWX_REBOOT As Long = 2
Const EWX_FORCE As Long = 4
Private Declare Function ExitWindows _
Lib "User32" Alias "ExitWindowsEx" _
(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long

Private Sub Command1_Click()

'Shut down windows
ExitWindows EWX_SHUTDOWN, &HFFFFFFFF


End Sub

Is This A Good Question/Topic? 0
  • +

Replies To: VB ExitWindows NOT WORKING

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: VB ExitWindows NOT WORKING

Posted 03 January 2011 - 07:36 AM

check our tutorial section next time. there is a snippet about it using Shell:
http://www.dreaminco...snippet3596.htm
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1