Solved

Global hook with WM_MOUSEWHEEL?

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now