Solved

Global hook with WM_MOUSEWHEEL?

Posted on 2003-11-09
4
1,100 Views
Last Modified: 2013-12-03
Hi,

I want to use WH_GETMESSAGE or any other type of global hook to get the WM_MOUSEWHEEL message from other program.
However, none of them seems to work.

Currently, I am using WH_GETMESSAGE as my hook type, and in hook procedure, i have

if (pMsg->message == WM_MOUSEWHEEL)
{
    // Do something here
}

this only works when i try to use wheel in my program; the program does not seem to get the wheel message from any other program.
I do not know if this is because the code is wrong, or just because other application does not fire WM_MOUSEWHEEL message.
If i check WM_LBUTTONDOWN instead of WM_MOUSEWHEEL, the program works fine.
If i use SPY++ to monitor other programs (like notepad), it seems like it ignores WM_MOUSEWHEEL or something.

Is there any way to get the WM_MOUSEWHEEL message or force other program to fire the message?

Thanks
0
Comment
Question by:CoolTsubasa
4 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 9711859
Have you made it a system-wide hook by placing the HookProc in a DLL? See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_hooks32.asp ("Win32 Hooks")
0
 

Author Comment

by:CoolTsubasa
ID: 9712288
Yes, it's system-wide hook.

And it works if i replace WM_MOUSEWHEEL message with WM_LBUTTONDOWN message.
0
 

Accepted Solution

by:
Chmod earned 0 total points
ID: 9768333
PAQ'd & 50 points refunded

Chmod
Community Support Moderator @ Experts Exchange
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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