Solved

Global hook with WM_MOUSEWHEEL?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and 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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

948 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

21 Experts available now in Live!

Get 1:1 Help Now