Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. ExitWindowsEx API Problem !!!

ExitWindowsEx API Problem !!!

Scheduled Pinned Locked Moved Visual Basic
helpjson
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Basavaraj P Umadi
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • B 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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Using ExitWindowsEx isn't really so straight forward. You might want to try looking at the example shown here[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups