Declare Function GetCursorPos Lib "user32 mouse position
Posted on 2007-03-23
I have got the following code from you guys to simulate the mouse move on a combo box for my tooltips.
I am trying to modify it where the tooltip will be dislayed on the entire combobox not just the dropdown arrow or the very beggining.
I am trying to trap the whole width of the combobox by using something like:
cboLeft = combo.left
cblRight = cboleft + combo.width
The problem is different measurments or ?
Rect.left gives 549 and combo.left gives 6540
How can i code this?
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
Private Type POINTAPI
x As Long
y As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Sub Timer1_Timer()
Dim lCmbHwnd As Long, lRet As Long
Dim rRect As RECT, mPoint As POINTAPI
lCmbHwnd = Combo1.hwnd
If (GetWindowRect(lCmbHwnd, rRect)) Then
If (rRect.Left <= mPoint.x And rRect.Right >= mPoint.x) And _
(rRect.Top <= mPoint.y And rRect.Bottom >= mPoint.y) Then
'user is in the region of the combo box