Exemple #1
0
 def HitTest(self):
     pt = POINT()
     if not user32.GetCursorPos(byref(pt)):
         raise WinError(GetLastError())
     hittest = self.DefWindowProc(self.Hwnd, self.Msg.WM_NCHITTEST, 0,
                                  MAKELONG(pt.x, pt.y))
     try:
         return HT_FLAGS[hittest]
     except:
         return 'unknown'
Exemple #2
0
 def Deselect(self, i, stop=0):
     if self.GetStyleL('style') & self.Style.LBS_MULTIPLESEL:
         if stop:
             result = self.SendMessage(self.Hwnd, self.Msg.LB_SELITEMRANGE,
                                       0, MAKELONG(i, stop))
             if result == LB_ERR: raise "could not select items"
         else:
             result = self.SendMessage(self.Hwnd, self.Msg.LB_SETSEL, 0, i)
             if result == LB_ERR: raise "could not deselect item"
     else:
         self.SendMessage(self.Hwnd, self.Msg.LB_SETCURSEL, -1, 0)
Exemple #3
0
 def SetRange(self, low=0, high=100):
     result = self.SendMessage(self.Hwnd, self.Msg.PBM_SETRANGE, 0,
                               MAKELONG(low, high))
     return (LOWORD(result), HIWORD(result))
Exemple #4
0
 def CharFromPos(self, x, y):
     result = self.SendMessage(self.Hwnd, self.Msg.EM_CHARFROMPOS, 0,
                               MAKELONG(x, y))
     return LOWORD(result)
Exemple #5
0
def CopyData(hwndSource, hwndDest, lp, data, reserved=0):
    p = create_string_buffer(SZ_GUID_COPYDATA + data)
    ## do not include NULL byte in cbData
    cd = COPYDATASTRUCT(MAKELONG(lp, reserved), sizeof(p) - 1, addressof(p))
    return bool(
        user32.SendMessageA(hwndDest, WM_COPYDATA, hwndSource, byref(cd)))
Exemple #6
0
	def AddressToDword(self, i0, i1, i2, i3):
		if not self._IsUByte(i0, i1, i2, i3):
			raise ValueError("invalid address: %s" % repr((i0, i1, i2, i3)))
		return MAKELONG(MAKEWORD(i3, i2), MAKEWORD(i1, i0))
Exemple #7
0
 def SetTrackTipPos(self, x, y):
     self.SendMessage(self.Hwnd, self.Msg.TTM_TRACKPOSITION, 0,
                      MAKELONG(x, y))
Exemple #8
0
 def DeselectItems(self, start, stop):
     result = self.SendMessage(self.Hwnd, self.Msg.LB_SELITEMRANGE, 0,
                               MAKELONG(start, stop))
     if result == LB_ERR: raise "could not deselect items"
Exemple #9
0
 def FindXY(self, x, y):
     result = self.SendMessage(self.Hwnd, self.Msg.LB_ITEMFROMPOINT, 0,
                               MAKELONG(x, y))
     if not HIWORD(result):
         return LOWORD(result)
Exemple #10
0
	def PlayAnim(self, repeat=-1, start=0, stop=-1):
		if not self.SendMessage(self.Hwnd, self.Msg.ACM_PLAY, repeat, MAKELONG(start, stop)):
			raise "could not play animation"
Exemple #11
0
	def SetItemSize(self, w, h): 
		result=self.SendMessage(self.Hwnd, self.Msg.TCM_SETITEMSIZE , 0, MAKELONG(w, h))
		return LOWORD(result), HIWORD(result)