Akshay Damle
Akshay Damle

Reputation: 1250

How to get the name of the currently active window in Python?

How do I get the name of the currently active window (the one which has been clicked on and is being interacted with by the user) in Python?

The Python script should keep running in the background and as I open applications, it should detect which application has been opened.

For example, if I play a movie using the VLC media player, my script must detect that the VLC media player window is currently active. If I switch to the Chrome browser, my script should detect that the Chrome browser is currently active.

Upvotes: 3

Views: 2371

Answers (1)

user2828830
user2828830

Reputation: 26

You could look at the following link and see what you can pull/use from it...all the best... http://sjohannes.wordpress.com/2012/03/23/win32-python-getting-all-window-titles/

Upvotes: 1

Related Questions