[comp.windows.ms.programmer] Hooking onto the mouse

hmolotsi@hpspcoi.HP.COM (Hugh Molotsi) (11/01/90)

Hi Windows hackers,

	Does anybody know how to hook onto the Window's mouse driver so
that an application can keep track of mouse messages in the background?
This can be done for the keyboard using SetWindowsHook() and the WH_KEYBOARD
hook (a la Petzold).

	
HNM: "I've fallen and I can't get up!" 

davidds@microsoft.UUCP (David D'SOUZA) (11/04/90)

Good question... So, why doesn't Windows have a WH_MOUSE hook?

Anyway, you have to use a WH_GETMESSAGE hook since all mouse messages
are picked up by apps at GetMessage time (and then dispatched to the
specific window procedure.)  The problem here is that you do take a bit
of a performance hit since another function call needs to occur
everytime an app does a getmessage.

--Dave


In article <13430001@hpspcoi.HP.COM> hmolotsi@hpspcoi.HP.COM (Hugh Molotsi) writes:
>Hi Windows hackers,
>
>	Does anybody know how to hook onto the Window's mouse driver so
>that an application can keep track of mouse messages in the background?
>This can be done for the keyboard using SetWindowsHook() and the WH_KEYBOARD
>hook (a la Petzold).
>
>	
>HNM: "I've fallen and I can't get up!"