Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Cheap Windows Reboot API Tutorial

From: depotcity::telus::net at: 15-Jun-2001 17:24

;For any interested in learning API's (like me) here's some code to reboot Windows using the "user32.dll" ;path to the user32.dll a: %/c/winnt/system32/user32.dll ;Load the .dll library loaded-dll: load/library a ;the function in the user32.dll that we want to use. This one logs off the user and reboots, case is important. ex: "ExitWindowsEx" ; make the routine.. requires two inputs as integer! uFlags and dwReserved, case is important Reboot: make routine! [ uFlags [integer!] dwReserved [integer!] ] loaded-dll ex ;once this routine is in place, just call it whenever with two zero's for the integers (not sure why it needs or accepts two zeros, but it works) Reboot 0 0 ;That's it ;Terry Brownell