def FindWindow(title, class_name, parent=0, child_after=0): """Finds a window of a given title and class. Args: title: Title of the window to search. class_name: Class name of the window to search. parent: Handle to the parent window whose child windows are to be searched. child_after: HWND to a child window. Search begins with the next child window in the Z order. Returns: Handle of the found window, or 0 if not found. """ hwnd = 0 try: hwnd = win32gui.FindWindowEx(int(parent), int(child_after), class_name, title) except win32gui.error as err: if err[0] == winrror.ERROR_INVALID_WINDOW_HANDLE: # Could be closed. pass elif err[0] != winrror.ERROR_FILE_NOT_FOUND: raise err if hwnd: win32gui.FlashWindow(hwnd, True) return hwnd
def FlashMyWindow2(title2): ID2 = win32gui.FindWindow(None, title2) win32gui.FlashWindow(ID2,True)
def FlashMyWindow(title): ID = win32gui.FindWindow(None, title) win32gui.FlashWindow(ID,True)
def SohbetPencere(baslik): ID = win32gui.FindWindow(None, baslik) win32gui.FlashWindow(ID, True)
def drawRect(self, x, y, w, h): win32gui.FlashWindow(self.hwnd, 0) self.prebrush = win32gui.SelectObject(self.hwndDC, self.hbrush) win32gui.Rectangle(self.hwndDC, x - 1, y - 1, x + w + 2, y + h + 2) # 左上到右下的坐标
def buy(): win32gui.FlashWindow(win32gui.GetForegroundWindow(), 0) print("! found")
def flashTitlebar(self, flag): id = win32gui.FindWindow(None, self.title) win32gui.FlashWindow(id, flag)
def FlashMyWindow(title): ID = win32gui.FindWindow(None, title) for i in range(0, 5): sleep(1) win32gui.FlashWindow(ID, True)