win32gui.EnumWindows problem in Python 2.2

griffin patrik at ucolick.org
Thu Dec 19 14:53:27 EST 2002


"Mark Hammond" <mhammond at skippinet.com.au> wrote in message
news:oJbM9.2945$W51.6599 at news-server.bigpond.net.au...
> I am surprised this ever worked as you describe.  The MS docs state:
> """
> If EnumWindowsProc returns zero, the return value is also zero.
> """
>
> which means that EnumWindows will always raise that exception if your
> handler returns 0.  I haven't a Python 2.0 handy, but 2.1 certainly does.
>
> Just catch and ignore the exception if exception[0]==0.

I guess I don't understand why this would raise an exception.  I'm looking
at the Win32gui documentation which says:
"Enumerates all top-level windows on the screen by passing the handle to
each window, in turn, to an application-defined callback function.
EnumWindows continues until the last top-level window is enumerated or the
callback function returns FALSE"

is there some exception-raising convention that is implicit here that I
don't know about?  (I'm pretty new to Win32.)

But who cares, I'll do as you say!  :-)

Thanks,

/Patrik







More information about the Python-list mailing list