窗口句柄 def foo(hwnd, mouse): #ttid, ppid = win32process.GetWindowThreadProcessId(hwnd) if win32gui.GetWindowText(hwnd) == "VALORANT ": hd.append(hwnd) print(hwnd) win32gui.EnumWindows(foo, 0)