当前位置: 首页 > 工具软件 > PythonWin > 使用案例 >

python win32 EnumWindows

楚硕
2023-12-01


python 小记


enum 所以有窗体



>>> def mycallback(hwnd,extra):

...     windowsTitle.append(win32gui.GetWindowText(hwnd))
...     print hwnd
...     

>>> win32gui.EnumWindows(mycallback,w)


不过,这里有点怪,enum 出来的,中文有问题, 需要转码,

如下

['', '', '', '', 'YodaoDictSCRTRLWnd', 'YoudaoDictStrokeIcon', '', 'YoudaoStrokeWnd', '', 'Google \xcb\xd1\xcb\xf7', 'python win32gui finding child windows - Stack Overflow', '', '', '', '', '', '', '', '', '', 'Start', '', '', '', '', 'PythonWin - [Interactive Window]', '', '', '[python-win32] win32ui screen capture - Grokbase - Mozilla Firefox', 'Msg', 


\xcb\xd1\xcb\xf7'   这中文


晕到了,我找到问题了,是2.7python 不支持,2.6 就行了




 类似资料:

相关阅读

相关文章

相关问答