Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Global hook with WM_MOUSEWHEEL?

Posted on 2003-11-09
4
Medium Priority
?
1,159 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
3 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

782 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