win32gui.EnumWindows

EnumWindows(callback, extra)

Enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function.

Parameters

callback : function

A Python function to be used as the callback. Function can return False to stop enumeration, or raise an exception.

extra : object

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