Getting focused window of another app

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Lewis

    Getting focused window of another app

    Anyone know how to get the caption of the window currently in focus in
    whatever app is in use? If I am using Excel, for example, I want my
    python app to know that Excel is currently being used.

  • Jim Lewis

    #2
    Re: Getting focused window of another app

    Never mind ...
    wHnd = win32gui.GetFor egroundWindow()
    Caption = win32gui.GetWin dowText (wHnd)

    Comment

    Working...