win32ui.GetForegroundWindow

PyCWnd = GetForegroundWindow()

Retrieves the foreground window.

Return Value

The result is a PyCWnd (or derived) object, or a win32ui.error exception is raised.