Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

WM_MOUSEMOVE

Posted on 1998-07-05
12
Medium Priority
?
947 Views
Last Modified: 2013-12-03
How do I get all child windows to propogate WM_MOUSEWHEEL up to my main window. The latest common controls dll includes controls which support WM_MOUSEWHEEL and now the controls are being stingy. I would like to keep them from using WM_MOUSEWHEEL so that my main window can.
0
Comment
Question by:overworked
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 400 total points
ID: 1409463
Your options are to:
1.  Supe-rclass or Sub-class the child windows and make the new window procedures pass the message on to the parent.
2.   Handle the message in the message loop before it is dispatched to the child windows. This only works if the message is posted, instead of sent (it probably is, but I didn't test).
3.  Use a system hook to get notification of the mouse wheel message.

I can elaborate on these if needed.
0
 

Author Comment

by:overworked
ID: 1409464
Hmm, i hate to subclass because there are so many controls. The message isn't getting to my dialog or window proc so mouse driver must be sending it directly to control cursor is over. Then if that control doesn't support it, it sends it up the parent chain. I guess the only thing then is a hook but I heard these slow system performance and I don't want to compromise that for support for mouse wheel. Perhaps the mouse wheel sdk has a function that will help.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1409465
What about WM_NOTIFY messages?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:overworked
ID: 1409466
Is there a wm_notify for mousewheel messages? I lost my sdk. Gotta go re-download.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1409467
No, you don't get WM_NOTIFY messages on a WM_MOUSEWHEEL.  

However, you might want to look into the WM_MOUSEMOVE message rather than the MOUSEWHEEL message.  This will not fix your problem at all.  However, you will get the MOUSEMOVE message less frequently than the MOUSEWHEEL message.  The MOUSEMOVE message onvle occurs when the mouse pointer moves to a new pixel.  That may be sufficient for your purposes and less taxing on the system.
0
 

Author Comment

by:overworked
ID: 1409468
Hmm, I don't follow in regards to the mousemove. Let me restate my problem: My main window has 10 modeless dialogs which are full of controls and so forth. When user moves mouse wheel, my main window scrolls the client up and down. However, when user clicks on any control, I lose my mouse wheel messages and they go to the control. I want to keep mouse wheel messages for my main window.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1409469
The mousemove as opposed to mousewheel is unrelated to your problem.  The reason I mentioned it is that there are potentially several mouse wheel messages generated for each mousemove message, thus you ussually would process mousemove rather than mousewheel.  Mousewheel occurs whenever the mouse (the physical mouse, not the pointer on the display) is moved.  Mousemove occurs only when the mouse pointer on the display moves..

That has nothing to do with your problem, just a suggestion for faster processing.  You still have to use the methods I suggested for processing either message.  Unless Alexo can ofter a better solution.  
0
 
LVL 22

Expert Comment

by:nietod
ID: 1409470
Do you have a working solution then?
0
 
LVL 11

Expert Comment

by:alexo
ID: 1409471
Docs say: "The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated.  The DefWindowProc function propagates the message to the window's parent.  There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it."  Meaning, you're SOL.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1409472
What about one of the 3 solutions I suggested?  Those should work, right?  (the message loop one might not, but I think it will.)
0
 
LVL 11

Expert Comment

by:alexo
ID: 1409473
Right.  But it's the hard work that overworked tried to avoid...
0
 

Author Comment

by:overworked
ID: 1409474
Well.. a msg hook on WH_MOUSE is no good cause it doesn't give me the MSG struc. WH_MSGFILTER is no good because it doesn't give me messages posted or sent directly to a control (just the wndproc/dlgproc). Since subclassing every control isn't justified to support a mousewheel (in my opinion), I decided to do a SetFocus after each BN_CLICK, CBN_CLOSEUP, and LBN_SELCHANGE to keep the focus on my main window instead of individual controls.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

618 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