コード例 #1
0
 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
コード例 #2
0
 def __call__(self):
     try:
         BringHwndToFront(self.plugin._hwnd)
         self.plugin.spotify.stop()
         CloseHwnd(self.plugin._hwnd)
     except:
         raise self.Exceptions.ProgramNotRunning
コード例 #3
0
 def BringDialogToFront(name):
     hwnd = 0
     i = 0
     while hwnd == 0 and i < 10000:
         hwnd = FindWindow("#32770", name)
         i += 1
     if hwnd:
         BringHwndToFront(hwnd)
コード例 #4
0
ファイル: __init__.py プロジェクト: maffe/EventGhost
 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
コード例 #5
0
 def OnClick(self, *dummyArgs):
     # Remove our tray icon and restore the window
     try:
         BringHwndToFront(hwnd)
     except:
         pass
     finally:
         trayIcon.RemoveIcon()
         trayIcon.Destroy()
コード例 #6
0
 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()
コード例 #7
0
 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
コード例 #8
0
ファイル: __init__.py プロジェクト: BaldrTheAesir/EventGhost
 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))
コード例 #9
0
ファイル: TaskBarIcon.py プロジェクト: maffe/EventGhost
    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()
コード例 #10
0
 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
コード例 #11
0
    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
コード例 #12
0
ファイル: __init__.py プロジェクト: BaldrTheAesir/EventGhost
 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()
コード例 #13
0
    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()
コード例 #14
0
 def Raise(self):
     BringHwndToFront(self.GetHandle())
     wx.Frame.Raise(self)
コード例 #15
0
 def __call__(self):
     for hwnd in GetTargetWindows():
         BringHwndToFront(hwnd)
 def __call__(self):
     hwnd = HandleLch()
     if hwnd:
         BringHwndToFront(hwnd)