python ctypes obtém janela atual
import ctypes
window = ctypes.windll.user32.GetForegroundWindow()
Strange Salmon
import ctypes
window = ctypes.windll.user32.GetForegroundWindow()