Skip to content

Instantly share code, notes, and snippets.

@tokibito
Created May 21, 2020 05:14
Show Gist options
  • Save tokibito/a51cdac2fc9d7391e1242ede2661f4d9 to your computer and use it in GitHub Desktop.
Save tokibito/a51cdac2fc9d7391e1242ede2661f4d9 to your computer and use it in GitHub Desktop.
get active window title
import win32gui
import time
while True:
handle = win32gui.GetForegroundWindow()
title = win32gui.GetWindowText(handle)
print(handle, title)
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment