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.
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.
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)
Amritpal SinghCommented:
we all suggested relative answers , points shud be split.
All Courses

From novice to tech pro — start learning today.