# -*- coding: utf-8 -*-
"""
Created on Mon Jun 17 22:55:29 2019
@author: Administrator
"""
import win32gui
hwnd_title = dict()
def get_all_hwnd(hwnd,mouse):
if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
hwnd_title.update({hwnd:win32gui.GetWindowText(hwnd)})
win32gui.EnumWindows(get_all_hwnd, 0)
for h,t in hwnd_title.items():
if t is not "":
print(h, t)
python3 遍历 所有句柄及窗口名称
最新推荐文章于 2024-08-07 02:05:28 发布