2

I want to write application in vc++, that listens for keyboard , mouse events , even when my vc++ application running in background i.e it must get the notification about events even if its focus gets lost, and ** I don't want to use any third party libraries. ** I did search for Hook mechanism, but that doesn't make any sense to me.

here is the link for Hook mechanism :

http://msdn.microsoft.com/en-us/library/ms632589%28v=vs.85%29.aspx

Jitesh V
  • 36
  • 7

1 Answers1

0

Windows OS does not emit any keyboard nor mouse events.

Window receives messages about mouse and keyboard activity. Maybe that is why hooking does not make sense to you.

If you want to receive mouse and keyboard messages from all application you will have to use hooks, namely low level hooks WH_KEYBOARD_LL and WH_MOUSE_LL that are global regardless if they are in the dll library or executable module.

What specifically does not make sense?

JohnCz
  • 1,613
  • 1
  • 9
  • 9
  • many many thankx for the reply. i am very new to this Hook mechanism, so please help me. i am writting application in vc++ , and i just want to know when exactly the keyboard gets activated regardless of which key get pressed. for eg. keyboard gets activated when we open notepad to write something , or while typing URL in URL bar. Rest of the time even if you press the keyboard key its of no use , unless and until notepad (or something like that) gets a Focus. so low level hooks namely **WH_KEYBOARD_LL and WH_MOUSE_LL** will do my work ? and can u please help me to proceed in this ??? – Jitesh V Oct 17 '12 at 14:51