Hi all,
Windows 2000 / 98: I'm trying to use the win32api.ExitWindowsEx()
function to restart a Windows system. The documentation is minimal to
say the least. The function requires two parameters: flags, and
reserved=0 (according to the docs). I'm not sure what the parameter
options are. I took a guess and tried win32api.ExitWindowsEx(2, 0),
hoping that the system would shut down and restart. As far as the
documentation goes, I'd say there's a good chance that these options
will shut down and restart the system. The documentation also says that
the command will check for open programs and give you the option to
close them. Now, when I run the script (Python 2.2.3) a dialog comes up
and says that 'python' is running (ok, pretty obvious) and gives me the
option to quit the app or cancel. The problem with this is that I would
like the script's execution to be scheduled and thus must not prompt for
user input (and obviously I don't want to exit the python interpreter
while it's running my script!).
I see at least three ways to solve this problem.
1) Pass the correct parameters to the ExitWindowsEx function.
or
2) Use a completely different module or another win32api function to
restart the machine.
or
3) Maybe there's a different way to send a restart command to Windows
which doesn't care whether there are any open programs or not.
Any suggestions will be greatly appreciated.
···
--
Regards,
Wayne Koorts
Registered Linux user #330079
Wouldn't you want to use win32api.InitiateSystemShutdown ...
win32api.InitiateSystemShutdown( machine, message, timeout, bForce,
bReboot )
machine - The name of machine to shutdown - None for current
message - A message to be displayed to user in dialog while timeout occurs
timeout - in secs
bForce - true/false - force pen apps closed
bReboot - true/false - specify if the machine is rebooted after shutdown
hope that helps ... thanks to Mark Hammond on that one 
···
----- Original Message -----
From: "Wayne Koorts" <wayne@cwazy.co.uk>
To: "wxPython-users" <wxPython-users@lists.wxwindows.org>
Sent: Friday, November 07, 2003 4:32 AM
Subject: [wxPython-users] OT (slightly): ExitWindowsEx issue
Hi all,
Windows 2000 / 98: I'm trying to use the win32api.ExitWindowsEx()
function to restart a Windows system. The documentation is minimal to
say the least. The function requires two parameters: flags, and
reserved=0 (according to the docs). I'm not sure what the parameter
options are. I took a guess and tried win32api.ExitWindowsEx(2, 0),
hoping that the system would shut down and restart. As far as the
documentation goes, I'd say there's a good chance that these options
will shut down and restart the system. The documentation also says that
the command will check for open programs and give you the option to
close them. Now, when I run the script (Python 2.2.3) a dialog comes up
and says that 'python' is running (ok, pretty obvious) and gives me the
option to quit the app or cancel. The problem with this is that I would
like the script's execution to be scheduled and thus must not prompt for
user input (and obviously I don't want to exit the python interpreter
while it's running my script!).
I see at least three ways to solve this problem.
1) Pass the correct parameters to the ExitWindowsEx function.
or
2) Use a completely different module or another win32api function to
restart the machine.
or
3) Maybe there's a different way to send a restart command to Windows
which doesn't care whether there are any open programs or not.
Any suggestions will be greatly appreciated.
--
Regards,
Wayne Koorts
Registered Linux user #330079
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.423 / Virus Database: 238 - Release Date: 26/11/2002