赞
踩
import win32gui def demo_top_windows(): ''' 演示如何列出所有的顶级窗口 :return: ''' hWndList = [] win32gui.EnumWindows(lambda hWnd, param: param.append(hWnd), hWndList) for hWnd in hWndList: title = win32gui.GetWindowText(hWnd) title = title.encode().decode('utf-8') clsname = win32gui.GetClassName(hWnd) print(hWnd,title,clsname) # hWnd windows pid # title 窗口标题 # clsname 窗口类名 print(hWndList) demo_top_windows()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。