Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Keep track of key press event of active window

Posted on 2004-10-28
7
Medium Priority
?
243 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:syswareinc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 672 total points
ID: 12434280
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
 
LVL 45

Assisted Solution

by:AndyAinscow
AndyAinscow earned 664 total points
ID: 12434854
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
 
LVL 6

Assisted Solution

by:Amritpal Singh
Amritpal Singh earned 664 total points
ID: 12441747
0
 
LVL 6

Expert Comment

by:Amritpal Singh
ID: 12817016
we all suggested relative answers , points shud be split.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question