MCPcopy Index your code
hub / github.com/PyQt5/PyQt / checkWindow

Method checkWindow

Demo/FollowWindow.py:35–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 self.checkTimer.start(10) # 10毫秒比较流畅
34
35 def checkWindow(self):
36 # 查找
37 hwnd = win32gui.FindWindow('Notepad', None)
38 if self.tmpHwnd and not hwnd:
39 # 表示记事本关闭了
40 self.checkTimer.stop()
41 self.close() # 关闭自己
42 return
43 if not hwnd:
44 return
45 self.tmpHwnd = hwnd
46 # 获取位置
47 rect = win32gui.GetWindowRect(hwnd)
48 print(rect)
49 self.move(rect[2], rect[1])
50
51
52if __name__ == '__main__':

Callers

nothing calls this directly

Calls 2

moveMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected