Re: restarting Windows from Eu
- Posted by A Batista <Albert.Batista at BMGDIRECT.COM> Feb 29, 2000
- 493 views
Actually, my first Euphoria program involved restarting windows. It was able to reboot using two different times of the day. I'll paste snippits of the lines I needed to get it done. atom User32, Reboot_code, Dummy_code integer zRebooter Reboot_code = 2 Dummy_code = 0 User32 = open_dll("user32.dll") zRebooter = linkProc(User32, "ExitWindowsEx", {C_LONG, C_LONG}) c_proc(zRebooter, {Reboot_code, Dummy_code}) That should be it. If someone else knows a better way, please tell! =) Btw, it will not reboot a windows NT machine since it involves setting a priviledge I haven't the foggiest about implementing yet. -----Original Message----- From: Brian Jackson [mailto:bjackson at 2FARGON.COM] Sent: Tuesday, February 29, 2000 9:29 AM To: EUPHORIA at LISTSERV.MUOHIO.EDU Subject: restarting Windows from Eu Hi all, I've been trying to figure out how to force windows to restart from a Euphoria program. I know that the command to do so is: rundll32.exe shell32.dll,SHExitWindowsEx 2 However, I can't get it to work using shellExecute() in win32lib (absolutely nothinhg happens), and if I try to use system_exec() then it refuses because it is running in a console window, and wants that to be closed before Windows will restart. Any suggestions? Brian