import win32con
import win32gui
import win32process

pid = 33216
print(f"Inspecting PID {pid}...")

hwnds = []
def enum_win(hwnd, _):
    _, win_pid = win32process.GetWindowThreadProcessId(hwnd)
    if win_pid == pid:
        hwnds.append(hwnd)

win32gui.EnumWindows(enum_win, None)
print(f"Total HWNDs found for PID {pid}: {len(hwnds)}")
for h in hwnds:
    title = win32gui.GetWindowText(h)
    visible = win32gui.IsWindowVisible(h)
    rect = win32gui.GetWindowRect(h)
    style = win32gui.GetWindowLong(h, win32con.GWL_STYLE)
    exstyle = win32gui.GetWindowLong(h, win32con.GWL_EXSTYLE)
    print(f"HWND: {h} | Title: '{title}' | Visible: {visible} | Rect: {rect} | Style: {hex(style)} | ExStyle: {hex(exstyle)}")
