Created
April 11, 2023 12:44
-
-
Save illixion/ef97f532a605f6ec4684eaf81bcc6b9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Finds any application that's stealing window focus and prints its name to the output | |
# Works on Windows 10/11 | |
# Install requirements with: pip install win32gui | |
from win32gui import GetWindowText, GetForegroundWindow | |
import time | |
active_prev = "" | |
while True: | |
time.sleep(0.1) | |
activeAppName = GetWindowText(GetForegroundWindow()) | |
if activeAppName != active_prev: | |
print(activeAppName) | |
active_prev = activeAppName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment