-
Jan 24th, 2025, 10:53 AM
#1
Thread Starter
Fanatic Member
3rd Party Combox and MouseWheel
Our application uses a 3rd party combo box control fairly heavily (Arcadia PowerCombo) and one thing that has been driving me nuts is, once the dropdown list is expanded, the list does not respond to the mouse wheel. When collapsed, it will respond. I tried using some code to intercept mouse wheel messages on the parent form, but once the dropdown list is expanded, no messages come through. Any thoughts on how to solve this?
-
Jan 24th, 2025, 10:58 AM
#2
Member
Re: 3rd Party Combox and MouseWheel
You can use Spy++ to see all the messages for the whole application. The normal location for it in the vb files is "C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools\SPYXX.EXE"
-
Jan 24th, 2025, 12:04 PM
#3
Thread Starter
Fanatic Member
Re: 3rd Party Combox and MouseWheel
 Originally Posted by DrBobby
You can use Spy++ to see all the messages for the whole application. The normal location for it in the vb files is "C:\Program Files (x86)\Microsoft Visual Studio\Common\Tools\SPYXX.EXE"
Already had tried that, unfortunately when I click outside the app, the dropdown closes and I can't get the messages for the combo box's dropdown list.
-
Jan 24th, 2025, 01:50 PM
#4
Re: 3rd Party Combox and MouseWheel
 Originally Posted by clarkgriswald
Our application uses a 3rd party combo box control fairly heavily (Arcadia PowerCombo) and one thing that has been driving me nuts is, once the dropdown list is expanded, the list does not respond to the mouse wheel. When collapsed, it will respond. I tried using some code to intercept mouse wheel messages on the parent form, but once the dropdown list is expanded, no messages come through. Any thoughts on how to solve this?
I'm sorry, but do you have the source or are you referring to the EXE?
-
Jan 24th, 2025, 01:57 PM
#5
Fanatic Member
Re: 3rd Party Combox and MouseWheel
try using The Trick class clsTrickSubclass2.
Code:
Option Explicit
Private Const WM_MOUSEWHEEL As Long = &H20A
Public Event MouseWheelUp()
Public Event MouseWheelDown()
Private l As Long
Dim WithEvents FormHook As clsTrickSubclass2
Private Sub Class_Initialize()
Set FormHook = New clsTrickSubclass2
End Sub
Private Sub Class_Terminate()
FormHook.UnHook
Set FormHook = Nothing
End Sub
Private Sub FormHook_WndProc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long, Ret As Long, DefCall As Boolean)
Select Case Msg
Case WM_MOUSEWHEEL
Dim zDelta As Long
zDelta = (wParam \ &H10000) And &HFFFF
If zDelta > 0 Then
RaiseEvent MouseWheelUp
Else
RaiseEvent MouseWheelDown
End If
Case Else
DefCall = True
End Select
End Sub
Public Function setup(lhwnd As Long) As Boolean
l = lhwnd
setup = FormHook.Hook(lhwnd)
End Function
Something similar has been done using the hwnd of your control
-
Jan 24th, 2025, 02:03 PM
#6
Thread Starter
Fanatic Member
Re: 3rd Party Combox and MouseWheel
 Originally Posted by Episcopal
I'm sorry, but do you have the source or are you referring to the EXE?
I am using the hook logic from here
As far as the code, if you have a look there, I am just logging the mouse wheel messages there. If the dropdown list of the combo is expanded while the mouse wheel is scrolled, no messages appear.
-
Jan 24th, 2025, 02:57 PM
#7
Re: 3rd Party Combox and MouseWheel
can u send messages into this 3rd party combobox?
I mean, the mouse wheel u can intercept yourself and u can also intercept the hwnd on top of the 3rd party combobox using a few API.
so, basically.
- subclassing mouse wheel and x/y position
- check if x/y position is on top of combobox or when "focus"
- check the mousewheel, and if so, send message to the combobox
if subclassing is not working, u need to go low-level and get the mouse wheel that way.
-
Jan 24th, 2025, 03:07 PM
#8
Thread Starter
Fanatic Member
Re: 3rd Party Combox and MouseWheel
 Originally Posted by baka
can u send messages into this 3rd party combobox?
I mean, the mouse wheel u can intercept yourself and u can also intercept the hwnd on top of the 3rd party combobox using a few API.
so, basically.
- subclassing mouse wheel and x/y position
- check if x/y position is on top of combobox or when "focus"
- check the mousewheel, and if so, send message to the combobox
if subclassing is not working, u need to go low-level and get the mouse wheel that way.
My guess is that the combo box is using a list control (or something similar) in its drop down state and it likely has an hWnd that I haven't been able to get just yet. May have to use EnumChildWindows to see if that works. Also there is no way for me to know if the dropdown is expanded, at least not via properties. You might be on the right track, but I would need to be able to capture the mouse wheel scroll, while the user is hovering the the expanded combo, and then send a scroll message to the child list of the dropdown. Still trying to figure this all out.
-
Feb 7th, 2025, 08:59 AM
#9
Thread Starter
Fanatic Member
Re: 3rd Party Combox and MouseWheel
Well even finding the two child window handles related to the 3rd party combo and hooking those using this code, the event never fires when I am wheeling over the combo's dropdown list. Any ideas?
-
Feb 7th, 2025, 12:57 PM
#10
Junior Member
Re: 3rd Party Combox and MouseWheel
Place the wheel hook on the form and use GetCursorPos and WindowFromPoint to get the window under the cursor, if it doesn't support wheel messages try simulating scroll messages (SB_LINEUP, SB_LINEDOWN) or try sending arrow key hits.
-
Feb 7th, 2025, 01:14 PM
#11
Thread Starter
Fanatic Member
Re: 3rd Party Combox and MouseWheel
 Originally Posted by anycoder
Place the wheel hook on the form and use GetCursorPos and WindowFromPoint to get the window under the cursor, if it doesn't support wheel messages try simulating scroll messages (SB_LINEUP, SB_LINEDOWN) or try sending arrow key hits.
Interesting idea, although I have many forms with many combo boxes, so that may be a bit tedious to manage. It would much better if I could just pass all combos to a method on form load; more extensible, know what I mean?
-
Feb 8th, 2025, 05:10 PM
#12
Addicted Member
Re: 3rd Party Combox and MouseWheel
Not sure if this is the same company which developed your combo control but maybe and maybe they still have somebody who remembers this or ?.
http://arcadiaapm.com/
-
Feb 9th, 2025, 05:05 AM
#13
Re: 3rd Party Combox and MouseWheel
theres many different ways to do that.
one way is to check the "hwnd" using a function that checks all the components.
the function will check everything u have in your form. and u can "compare" if the .hwnd is the correct one,
u can check what kind of component and u can also "tag" it, if u need for specific instructions.
something like this:
Code:
Dim ctrl As Control
For Each ctrl In Form1.Controls
If TypeOf ctrl Is ComboBox Then
End If
Next
now u can use ctrl to check any parameters, hwnd, tags, name, index etc.
surely if u have multiple forms, each form need to send its "form", so it will loop the correct one.
Last edited by baka; Feb 9th, 2025 at 05:15 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|