def __start__(self, *dummyArgs): self.names, self.hwnds = EnumProcesses() self.flashing = set() self.lastActivated = None eg.messageReceiver.AddHandler(WM_APP + 1, self.WindowGotFocusProc) eg.messageReceiver.AddHandler(WM_APP + 2, self.WindowCreatedProc) eg.messageReceiver.AddHandler(WM_APP + 3, self.WindowDestroyedProc) eg.messageReceiver.AddHandler(WM_SHELLHOOKMESSAGE, self.MyWndProc) RegisterShellHookWindow(eg.messageReceiver.hwnd) self.hookDll = CDLL(abspath(join(dirname(__file__), "TaskHook.dll"))) self.hookDll.StartHook() trayWindow = 0 if "explorer" in self.names: for hwnd in self.names["explorer"].hwnds: if GetClassName(hwnd) == "Shell_TrayWnd": trayWindow = hwnd break self.desktopHwnds = (GetShellWindow(), trayWindow)
def __start__(self, *dummyArgs): self.pids, self.hwnds = EnumProcesses() self.flashing = set() self.lastActivated = None eg.messageReceiver.AddHandler(WM_APP + 1, self.WindowGotFocusProc) eg.messageReceiver.AddHandler(WM_APP + 2, self.WindowCreatedProc) eg.messageReceiver.AddHandler(WM_APP + 3, self.WindowDestroyedProc) eg.messageReceiver.AddHandler(WM_SHELLHOOKMESSAGE, self.MyWndProc) RegisterShellHookWindow(eg.messageReceiver.hwnd) trayWindow = 0 for explorerPid in [ x for x in self.pids if self.pids[x].name == "explorer" ]: for hwnd in self.pids[explorerPid].hwnds: if GetClassName(hwnd) == "Shell_TrayWnd": trayWindow = hwnd break if trayWindow != 0: break self.desktopHwnds = (GetShellWindow(), trayWindow)