예제 #1
0
 def __call__(self):
     hwnds = Handle()
     if len(hwnds) > 0:
         SendMessageTimeout(hwnds[0], WM_SYSCOMMAND, self.value, 0)
     else:
         self.PrintError(self.plugin.text.text1)
         return self.plugin.text.text1
예제 #2
0
 def __call__(self):
     FindWindow = FindWindowFunction(u'Slider1', u'msctls_trackbar32', 1)
     hwnds = FindWindow()
     if len(hwnds) != 0:
         return 100 - 5 * SendMessageTimeout(hwnds[0], TBM_GETPOS, 0, 0)
     else:
         self.PrintError(self.plugin.text.text1)
         return self.plugin.text.text1
예제 #3
0
 def __call__(self):
     hwnds = MyWindowMatcher()
     if len(hwnds) == 0:
         raise self.Exceptions.ProgramNotRunning
     try:
         for hwnd in hwnds:
             SendMessageTimeout(hwnd, 1347, 0, self.value)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #4
0
 def __call__(self):
     hwnds = Handle()
     if len(hwnds) > 0:
         SendMessageTimeout(hwnds[0], WM_SYSCOMMAND, self.value, 0)
     else:
         self.PrintError(self.plugin.text.text1)
         return self.plugin.text.text1
     if self.plugin.path2:
         self.plugin.Execute('Stop_SR_Events.exe', self.plugin.path2)
예제 #5
0
 def SendCommand(self, idMessage, wParam, lParam=0):
     """
     Find Winamp's message window and send it a message with 
     SendMessageTimeout.
     """
     try:
         hWinamp = FindWindow('Winamp v1.x')
         return SendMessageTimeout(hWinamp, idMessage, wParam, lParam)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #6
0
 def __call__(self):
     """
     Find WMPlayer's message window and send it a message with
     SendMessageTimeout.
     """
     try:
         hWMP = FindWindow('WMPlayerApp', None)
         return SendMessageTimeout(hWMP, WM_COMMAND, self.value, 0)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #7
0
 def __call__(self):
     """
     Find SageTV's message window and send it a message with
     SendMessageTimeout.
     """
     try:
         hwnd = FindWindow(self.plugin.targetClass, "SageWin")
         # WM_USER + 234 = 1258
         return SendMessageTimeout(hwnd, 1258, self.value, self.value)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #8
0
 def __call__(self, volume):
     FindWindow = FindWindowFunction(u'Slider1', u'msctls_trackbar32', 1)
     hwnds = FindWindow()
     if len(hwnds) != 0:
         vol = SendMessageTimeout(hwnds[0], TBM_GETPOS, 0, 0)
         step = -20 + vol + volume / 5
         if step <> 0:
             key = u'{Up}' if step > 0 else u'{Down}'
             for n in range(abs(step)):
                 eg.SendKeys(hwnds[0], key, False)
     else:
         self.PrintError(self.plugin.text.text1)
         return self.plugin.text.text1
예제 #9
0
 def __call__(self):
     FindWindow = FindWindowFunction(u'Slider1', u'msctls_trackbar32', 1)
     hwnds = FindWindow()
     if len(hwnds) != 0:
         volume = SendMessageTimeout(hwnds[0], TBM_GETPOS, 0, 0)
         if eval(self.value[0]):
             eg.SendKeys(hwnds[0], self.value[1], False)
             #PostMessage(hwnds[0], TBM_SETPOS, 1, volume-1)
         else:
             volume = self.value[2]
         return 100 - 5 * (volume + self.value[3])
     else:
         self.PrintError(self.plugin.text.text1)
         return self.plugin.text.text1
예제 #10
0
 def SendCommand(self, idMessage, wParam, lParam=0):
     """
     Find Winamp's message window and send it a message with
     SendMessageTimeout.
     """
     global sendWAActive
     while sendWAActive:
       sleep(0.1)
     sendWAActive =True
     try:
         hWinamp = FindWindow('Winamp v1.x')
         data = SendMessageTimeout(hWinamp, idMessage, wParam, lParam)
         sendWAActive =False
         return data
     except:
         sendWAActive =False
         raise self.Exceptions.ProgramNotRunning
예제 #11
0
 def __call__(self):
     key = self.plugin.dh.document['NotPlaying']
     FindWindow = FindWindowFunction(key, u'Static', 1)
     hwnds = FindWindow()
     if len(hwnds) > 0:  #Not playing
         key = eval("self.plugin.dh.document[self.value[0]]")
         ret = "1"
     else:  #Playing
         key = eval("self.plugin.dh.document[self.value[1]]")
         ret = "0"
     FindWindow = FindWindowFunction(key, u'Button', 1)
     hwnds = FindWindow()
     if len(hwnds) != 0:
         SendMessageTimeout(hwnds[0], BM_CLICK, 0, 0)
         return ret
     else:
         self.PrintError(self.plugin.text.text1)
         return self.plugin.text.text1
예제 #12
0
 def __call__(self):
     key = eval("self.plugin.dh.document[self.value[0]]")
     FindWindow = FindWindowFunction(key, u'Button', 1)
     hwnds = FindWindow()
     if self.value[1] != "":  #for toggle actions
         ret = "0"
         if len(hwnds) == 0:
             key = eval("self.plugin.dh.document[self.value[1]]")
             FindWindow = FindWindowFunction(key, u'Button', 1)
             hwnds = FindWindow()
             ret = "1"
     else:
         ret = " "
     if len(hwnds) != 0:
         SendMessageTimeout(hwnds[0], BM_CLICK, 0, 0)
         return ret
     else:
         self.PrintError(self.plugin.text.text1)
         return self.plugin.text.text1
예제 #13
0
 def __call__(self):
     try:
         hWnd = FindWindow("GomPlayer1.x")
         return SendMessageTimeout(hWnd, WM_COMMAND, self.value, 0)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #14
0
 def __call__(self):
     try:
         hWnd = FindWindow("TDVBMainForm", "MyTheatre")
         return SendMessageTimeout(hWnd, 3025, self.value, 0)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #15
0
 def __call__(self):
     try:
         hWnd = FindWindow("TVcCore-RemoteMSG-Class")
         return SendMessageTimeout(hWnd, WM_COMMAND, self.value, 0)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #16
0
 def __call__(self):
     try:
         hwnd = gWindowMatcher()[0]
         return SendMessageTimeout(hwnd, 32768, 24, self.value)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #17
0
 def __call__(self):
     try:
         hWnd = FindWindow("BSPlayer")
         return SendMessageTimeout(hWnd, WM_BSP_CMD, self.value, 0)
     except:
         raise self.Exceptions.ProgramNotRunning
예제 #18
0
    def SendCommand(self, msg, wParam, lParam):
        hwnd = gWindowMatcher()
	if hwnd:
            return SendMessageTimeout(hwnd, msg, wParam, lParam)
        else:
            raise self.Exceptions.ProgramNotRunning