june said:
It is for hardware testing, I need test the each button of mouse function
well or not.
You can't just build an application to respond to the messages without
tricks?
The wParam and lParam parameters contain information about a mouse message.
wParam
[in] This parameter can be one of the following messages: WM_LBUTTONDOWN,
WM_LBUTTONUP, WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_RBUTTONDOWN, or WM_RBUTTONUP.
---- seems not cover all I need
It looks to me like the MSLLHOOKSTRUCT structure whose address is passed in
lParam has information about the "X Buttons" too. The X Buttons are
described here:
http://msdn.microsoft.com/library/d...face/userinput/mouseinput/aboutmouseinput.asp
Sorry I must mis-interpret it. It is a dialog window (MFC), not a pop out
dialog. No parent window. All WM_Input test is for the dialog window
Messages are routed to windows. When those windows are controls defined by
the system, then it is not easy either to see how a message is handled or to
modify the handling. To do that you can get the control to pass a copy of
the message to its parent (typically a user dialog). It's not the same thing
as a hook but it does allow you to inspect or modify behavior. I had thought
that you simply wanted to intercept messages destined for another window.
In general, hooks (especially system hooks) should be avoided. They are very
intrusive. And it is far to easy for a hook procedure to cause a change in
behavior just because it is there. Check the docs for the low level hook.
They specifically warn not to spend too much time (more than the period
specified here: HKEY_CURRENT_USER\Control
Panel\Desktop\LowLevelHooksTimeout) in the handler.
Regards,
Will