Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting keystate in MouseProc hook proc

48 views
Skip to first unread message

Narc99

unread,
Mar 24, 2009, 4:56:41 PM3/24/09
to
In a MouseProc hook procedure, the WPARAM specifies the mouse message and
the LPARAM points to a MOUSEHOOKSTRUCT. There is a member of this structure
called dwExtraInfo, which does not seem to be well-documented. What
information does it contain or point to? In particular, is there a way to
get the keystate (MK_CONTROL, MK_LBUTTON, etc) from this member?


nico

unread,
Mar 24, 2009, 11:07:37 PM3/24/09
to

"Narc99" <noe...@nowhere.com> wrote in message
news:gqbhd9$r2g$1...@aioe.org...

You don't need dwExtraInfo (driver information)
WPARAM is sufficient to know which button is down (WM_LBUTTONDOWN,
WM_RBUTTONDOWN, WM_MBUTTONDOWN,..)


Narc99

unread,
Mar 24, 2009, 11:41:59 PM3/24/09
to
"nico" <ni...@jike.com> wrote in message
news:gqc75q$ieq$1...@news.motzarella.org...

That does not seem to be correct.

MouseProc has three parameters:
nCode: Hook procedure code
wParam: Mouse message identifier
lParam: Pointer to MOUSEHOOKSTRUCT

The MOUSEHOOKSTRUCT contains:
pt: POINT struct containing cursor position
hwnd: hwnd of window that will receive the msg
wHitTestCode: hit-test value
dwExtraInfo: "extra information"

Therefore, since the key-state (i.e., whether the control
or shift key, etc., is pressed) is no where to be found, I
was wondering if the dwExtraInfo member might contain
it or point to it, or in general how one would obtain that
information.


Scott Seligman

unread,
Mar 24, 2009, 11:45:48 PM3/24/09
to
"Narc99" <noe...@nowhere.com> wrote:
>Therefore, since the key-state (i.e., whether the control
>or shift key, etc., is pressed) is no where to be found, I
>was wondering if the dwExtraInfo member might contain
>it or point to it, or in general how one would obtain that
>information.

Use GetKeyState() to get key state.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
An old friend of mine once quoted me an ancient Egyptian blessing:
'God be between you and harm in all the empty places where you must
walk.' -- Sheridan in Babylon 5:"A Distant Star"

0 new messages