win32gui.EnumThreadWindows

EnumThreadWindows(dwThreadId, callback, extra)

Enumerates all top-level windows associated with a thread on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last top-level window associated with the thread is enumerated or the callback function returns FALSE

Parameters

dwThreadId : int

The id of the thread for which the windows need to be enumerated.

callback : object

A Python function to be used as the callback.

extra : object

Any python object - this is passed to the callback function as the second param (first is the hwnd).