Julius wrote: > On Tue, 2008-03-11 at 16:13 -0700, Tim Roberts wrote: > >> Julius wrote: >> >>> My fault(already got that one running), i meant the >>> win32gui.EnumChildWindows(currentHwnd, windowEnumerationHandler, >>> childWindows) >>> function. >>> >>> from what i understand the purpose of this function is to return the >>> childwindows from a top window - if this is right why not just pass a >>> topwindow as argument and return a list of childwindows? >>> >>> >> Windows APIs don't ever return lists of things, because it present a >> memory management difficulty. Who allocates, who owns, who releases, >> etc. Instead, they all use the "enumeration callback" concept. That >> way, if you want a list, you can construct and maintain it yourself. >> >> If you just want the list of handles, you can do something like this: >> childlist = [] >> win32ui.EnumChildWindows( hwnd, lamba hwnd,oldlist: oldlist.append( >> hwnd ), childlist ) >> > > Ok, havent tried it yet but im sure it will work. >
Actually, if that's really what I typed, I made a mistake. It's win32gui, not win32ui. > But why isnt there any documentation what the arguments are good for? > In part, because these are simple mappings of Windows APIs. You can go to MSDN to get information on the actual parameters to EnumChildWindows in excruciating detail. In most cases, the mapping from the C API to the Python API is quite clear, and this is one such case. The C API gets a top-level window handle, a callback function, and a context parameter. That's exactly what the win32ui version wants. It would be a very large effort with a very small payback to retype all of the Windows API documentation in Python terms. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32