I am using this code to obtain current window
from typing import Optional from ctypes import wintypes, windll, create_unicode_buffer def getForegroundWindowT