Question

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

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top