Re: Creating directories and restarting a computer
- Posted by Jeffrey Fielding <JJProg at cyberbury.net> Mar 06, 2001
- 379 views
Here's some (untested) code to shutdown, logoff, or restart in windows: include dll.e constant USER32 = open_dll("user32") constant SHUTDOWNEX = define_c_func(USER32, "ExitWindowsEx", {C_UINT, C_LONG}, C_INT) global constant EWX_FORCE = 4, -- Force processes to terminate, don't send -- WM_QUERYENDSESSION or WM_ENDSESSION -- only use in an emergency EWX_LOGOFF = 0, EWX_POWEROFF = 8, EWX_REBOOT = 2, EWX_SHUTDOWN = 1 global procedure win32_shutdown(integer shutdown_type) integer x x = c_func(SHUTDOWNEX, {shutdown_type, 0}) end procedure