MCPcopy Create free account
hub / github.com/PyQt5/PyQt / _enumWindows

Method _enumWindows

Demo/EmbedWindow.py:103–112  ·  view source on GitHub ↗

遍历回调函数

(self, hwnd, _)

Source from the content-addressed store, hash-verified

101 win32gui.SetWindowPos(hwnd, 0, wrect[0], wrect[1], wrect[2], wrect[3], win32con.SWP_NOACTIVATE)
102
103 def _enumWindows(self, hwnd, _):
104 """遍历回调函数"""
105 if hwnd == self.myhwnd:
106 return # 防止自己嵌入自己
107 if win32gui.IsWindow(hwnd) and win32gui.IsWindowVisible(hwnd) and win32gui.IsWindowEnabled(hwnd):
108 phwnd = win32gui.GetParent(hwnd)
109 title = win32gui.GetWindowText(hwnd)
110 name = win32gui.GetClassName(hwnd)
111 self.windowList.addItem(
112 '{0}|{1}|\t标题:{2}\t|\t类名:{3}'.format(hwnd, phwnd, title, name))
113
114
115if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

addItemMethod · 0.45

Tested by

no test coverage detected