[python-win32] EnumChildWindows
Tim Roberts
timr at probo.com
Mon Aug 20 23:24:21 CEST 2007
Radu Ciora wrote:
> Hi everyone,
> can anyone give me an example of use of win32gui.EnumChildWindows()
> function
> as I can't seem to make it work:
>
> my code looks like this:
> ...
> win32gui.EnumChildWindows(l_hwnd, self.windowEnumerationHandler(),
> l_childlist)
That can't be your code. That calls windowEnumerationHandler, rather
than passing the address of it.
> ...
> def windowEnumerationHandler(hwnd, resultList):
Remember that a member function always gets a "self" parameter first.
All you need to do is change those two lines to:
win32gui.EnumChildWindows( l_hwnd, self.windowEnumerationHandler,
l_childlist )
...
def windowEnumerationHandler( self, hwnd, resultList ):
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list