def callback(dummyHwnd, dummyMesg, wParam, lParam): pids = GetPids(hwnd=lParam) pid = pids[0] if pids else False if pid == processInformation.dwProcessId: try: eg.messageReceiver.RemoveHandler( WM_SHELLHOOKMESSAGE, refCallback) except: pass sleep(0.3) # Wait for windows to appear hwnds = GetHwnds(pid=processInformation.dwProcessId) if hwnds: #print "Focused via GetHwnds" for hwnd in hwnds: if IsWindowVisible(hwnd): BringHwndToFront(hwnd) break elif IsWindowVisible(lParam): #print "Focused via ShellHook" BringHwndToFront(lParam) elif not ProcessExists(processInformation.dwProcessId): try: eg.messageReceiver.RemoveHandler( WM_SHELLHOOKMESSAGE, refCallback) except: pass try: eg.plugins.Window.FindWindow(basename(pathname)) if len(eg.lastFoundWindows): #print "Focused via FindWindow" BringHwndToFront(eg.lastFoundWindows[0]) except: pass
def __call__(self): try: BringHwndToFront(self.plugin._hwnd) self.plugin.spotify.stop() CloseHwnd(self.plugin._hwnd) except: raise self.Exceptions.ProgramNotRunning
def BringDialogToFront(name): hwnd = 0 i = 0 while hwnd == 0 and i < 10000: hwnd = FindWindow("#32770", name) i += 1 if hwnd: BringHwndToFront(hwnd)
def __call__(self): self.SendCommand(WM_COMMAND, 40194) try: # Skinned JTFE doesn't auto-focus itself, so let's do that manually hwnd = FindWindow("BaseWindow_RootWnd", "Jump to file") BringHwndToFront(hwnd) except WindowsError: pass # Window not found; user is probably using unskinned JTFE
def OnClick(self, *dummyArgs): # Remove our tray icon and restore the window try: BringHwndToFront(hwnd) except: pass finally: trayIcon.RemoveIcon() trayIcon.Destroy()
def OnClick2(): # Remove our tray icon and restore the window try: BringHwndToFront(hwnd) del self.plugin.iconDict[hwnd] except: pass finally: trayIcon.RemoveIcon() trayIcon.Destroy()
def __call__(self): for hwnd in GetTargetWindows(): BringHwndToFront(hwnd) if hwnd in self.plugin.iconDict: try: trayIcon = self.plugin.iconDict[hwnd] del self.plugin.iconDict[hwnd] trayIcon.RemoveIcon() trayIcon.Destroy() except: pass
def SetDrawing(self, drawFunc, args): self.drawing = drawFunc d = GetMonitorDimensions()[self.displayNum] self.SetDimensions(d.x, d.y, d.width, d.height) self._buffer = wx.EmptyBitmap(d.width, d.height) dc = wx.BufferedDC(wx.ClientDC(self), self._buffer) self.drawing(dc, *args) #self.Refresh(eraseBackground=False) wx.Frame.Show(self, True) BringHwndToFront(self.GetHandle(), False) self.SetCursor(wx.StockCursor(wx.CURSOR_BLANK))
def OnCmdExit(self, event): if eg.mainFrame is None or len(eg.mainFrame.openDialogs) == 0: eg.app.Exit(event) else: eg.mainFrame.Iconize(False) eg.mainFrame.Raise() for dialog in eg.mainFrame.openDialogs: dialog.Iconize(False) BringHwndToFront(dialog.GetHandle()) dialog.Raise() dialog.RequestUserAttention() eg.mainFrame.RequestUserAttention()
def __call__(self): sh = win32com.client.Dispatch("WScript.Shell") win32api.Sleep(100) if self.plugin.bSpotifyObjectCreated: hWnd = win32gui.FindWindow("SpotifyMainWindow", None) BringHwndToFront(hWnd) win32api.Sleep(200) sh.AppActivate("spotify") win32api.Sleep(100) sh.SendKeys("{UP}") win32api.Sleep(10) sh.SendKeys("~~~~") del hWnd del sh return
def __call__(self): try: BringHwndToFront(self.plugin._hwnd) win32api.Sleep(100) except: raise self.Exceptions.ProgramNotRunning if self.plugin.bSpotifyObjectCreated: if not self.plugin.spotify.isPlaying(): self.plugin.spotify.playpause() res = self.GetPlayingStatus() print res return else: print self.plugin.text.infoStatus
def run(self): while not self.abort: hwnd = HandleLch() if hwnd: lines, mess = self.GetLineCount(hwnd, self.lines) if lines > self.lines: self.lines = lines eg.TriggerEvent(self.suffix[0], prefix = "FomineLANChat", payload = mess) if self.bring: BringHwndToFront(hwnd) users = self.GetUserCount(hwnd) if users != self.users: self.users = users eg.TriggerEvent(self.suffix[1], prefix = "FomineLANChat", payload = self.users) if self.abort: break self.threadFlag.wait(self.period) self.threadFlag.clear()
def OnClose(self, dummyEvent): """ Handle wx.EVT_CLOSE """ if eg.config.hideOnClose: self.Iconize(True) elif len(self.openDialogs) == 0: eg.app.Exit() else: self.Iconize(False) self.Raise() for dialog in self.openDialogs: dialog.Iconize(False) BringHwndToFront(dialog.GetHandle()) dialog.Raise() dialog.RequestUserAttention() self.RequestUserAttention()
def Raise(self): BringHwndToFront(self.GetHandle()) wx.Frame.Raise(self)
def __call__(self): for hwnd in GetTargetWindows(): BringHwndToFront(hwnd)
def __call__(self): hwnd = HandleLch() if hwnd: BringHwndToFront(hwnd)