?
Solved

Hack to simulate mouse-move for a combo box

Posted on 2006-11-16
6
Medium Priority
?
298 Views
Last Modified: 2010-04-30
Hi Experts
I have a form with checkboxs, textboxs, command buttons etc.
I use a custom tooltip based on mousemove using the hwnd of the control
The combox does not have a mousemove to open my tooltips.
Does anyone know of a workaround or a solutaion?
0
Comment
Question by:isnoend2001
  • 3
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 1000 total points
ID: 17962285
Hi Isnoend2001,

Here is a function that I wrote for you, put the code in a timer with interval 100 or so.




Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type
Private Type POINTAPI
        x As Long
        y As Long
End Type

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
    GetCursorPos mPoint
   
    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
            MsgBox "Hello"
    End If
End If

End Sub





Good Luck!
Brian
0
 
LVL 28

Expert Comment

by:Ark
ID: 17962443
0
 

Author Comment

by:isnoend2001
ID: 17962700
Thanks guys
My program is dowloaded and installed on customers machines and i try to keep it small.
adding a timer adds another ocx, seems it was pretty big.
I have tons of custom tool tips installed and do not want redo them or add another dll to distribute.
I am looking for simple hack.
If not i guess i will stick with plain small vb tooltip

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 17962711
A timer is not an additional OCX.

The code I've provided is about as small as it gets. The code I've suggested only uses the Windows API.

Brian
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 17962712
My code will simply tell you when the mouse is over a combo box.
0
 

Author Comment

by:isnoend2001
ID: 17963114
I was thinking the last couple yrs the timer was an additional ocx
thank you
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question