[python-win32] Win32 Mode

Mark Hammond mhammond at skippinet.com.au
Sun Nov 30 05:06:19 EST 2003


My guess is you are running Win9x - these functions only exist in the NT
family (NT/2k/xp).  The MSDN docs document what functions can be used where,
and I haven't tried to mirror that in the PyWin32 docs.

Do a google search for how to shutdown 9x - IIRC, it is simply a matter of
sending explorer a message.  (Initially, avoid 'python' in your search - it
may still give you the clue)

Mark.
  -----Original Message-----
  From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of Ray Pasco
  Sent: Saturday, 29 November 2003 11:55 PM
  To: Python-win32 at python.org
  Subject: Re: [python-win32] Win32 Mode


  That's not what seems to be happening.  Here's the entire code:

      import win32api
      win32api.InitiateSystemShutdown ('', '', 0, 1, 1)

  and this is the result:

      Traceback (most recent call last):
        File "try.py", line 9, in ?
          win32api.InitiateSystemShutdown ('', '', 0, 1, 1)
      pywintypes.error: (120, 'InitiateSystemShutdown', 'This function is
only valid in Win32 mode.')

  Hmmmm...

  Mark Hammond wrote:

It doesn't - you just import the modules, and away you go.  If the modules
aren't installed, you get an ImportError you can handle any way you like.

Mark.

  -----Original Message-----
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of Ray Pasco
Sent: Saturday, 29 November 2003 2:07 PM
To: python-win32 at python.org
Subject: [python-win32] Win32 Mode


How can a script be "put in" Win32 mode in order to use some of the
win32api calls ?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20031130/0196e92a/attachment.html


More information about the Python-win32 mailing list