ExitWindowsEx API Problem !!!
-
hello, i tried to use the
ExitWindowsEx()
WINAPI in Visual Basic 6, i use Windows XP OS and i want to reboot my pc after some installation (designed in vb). the parameters include 0 for logoff, 1 for shutdown and 2 for reboot..... if i use 0 (logoff) it works fine, but when i use 1 or 2 .... it wont execute... enters into err handler... here is the code...If ExitWindowsEx(2, 0) = 0 Then MsgBox "The system could not REBOOT the machine. !" End If
previous to this we need to define the function..Public Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long)
plz help me... - thanks, Basavaraj P.Umadi -
hello, i tried to use the
ExitWindowsEx()
WINAPI in Visual Basic 6, i use Windows XP OS and i want to reboot my pc after some installation (designed in vb). the parameters include 0 for logoff, 1 for shutdown and 2 for reboot..... if i use 0 (logoff) it works fine, but when i use 1 or 2 .... it wont execute... enters into err handler... here is the code...If ExitWindowsEx(2, 0) = 0 Then MsgBox "The system could not REBOOT the machine. !" End If
previous to this we need to define the function..Public Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long)
plz help me... - thanks, Basavaraj P.Umadi