Solved

Global hook with WM_MOUSEWHEEL?

Posted on 2003-11-09
4
1,121 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
[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
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

628 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