How to determine the control under cursor
-
Hello community, i need to determine the control under the cursor, to call "vertical scroll" event for it! I have two CListCtrl-controls in my dialog, so if the mouse is over one of them, it should be possible to scroll in this control without clicking inside of control! Just like in MS Outlook, if mouse is over "preview" area, you can use mouse wheel without clicking in this control to scroll! Thanks for any help! Arrin
-
Hello community, i need to determine the control under the cursor, to call "vertical scroll" event for it! I have two CListCtrl-controls in my dialog, so if the mouse is over one of them, it should be possible to scroll in this control without clicking inside of control! Just like in MS Outlook, if mouse is over "preview" area, you can use mouse wheel without clicking in this control to scroll! Thanks for any help! Arrin
Well the cheap and cheerful way would be to call WindowFromPoint[^] when you have a
WM_MOUSEWHEEL
message. That will return the handle of the window/control under the mouse, then you can justSendMessage
it the scroll. -
Well the cheap and cheerful way would be to call WindowFromPoint[^] when you have a
WM_MOUSEWHEEL
message. That will return the handle of the window/control under the mouse, then you can justSendMessage
it the scroll.Hello, thanks for answer,i try to do this, but there is an little problem :) when i use WM_MOUSEWHEEL windows catch this event only i my mouse is not over a CListCtrl! :( But i need to use when is OVER an CListCtrl, to set set focus to this list control! regards Arrin
-
Hello, thanks for answer,i try to do this, but there is an little problem :) when i use WM_MOUSEWHEEL windows catch this event only i my mouse is not over a CListCtrl! :( But i need to use when is OVER an CListCtrl, to set set focus to this list control! regards Arrin
Try adding the wm_mousewheel handler in the dialog class. This message is always sent to parent first and then passed down to children
-
Try adding the wm_mousewheel handler in the dialog class. This message is always sent to parent first and then passed down to children
-
Well the cheap and cheerful way would be to call WindowFromPoint[^] when you have a
WM_MOUSEWHEEL
message. That will return the handle of the window/control under the mouse, then you can justSendMessage
it the scroll.