Keep track of key press event of active window

I have two separate application. One application is active and another is running in background. Now I want to keep track of key press event of active application through application running in background. How can I do this in MFC.
syswareincAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
There is no specific MFC functions for windows hooking. Just have to use SetWindowsHookEx WinAPI's function.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.asp
0
 
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
You could just pass a duplictae of the keypress to the background app from your main app (use RegisterWindowsMessage to generate a unique message)
0
 
Amritpal SinghCommented:
we all suggested relative answers , points shud be split.
0
All Courses

From novice to tech pro — start learning today.