Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Is there any way to know application change event???

ie, I have an application in MFC feature pack.
I need to update the CView while the user switches back to my application after doing some work in another application.

Hope you understand my problem???
Posted

1 solution

Hello , i am not sure for what kind of focus you are talking but here are my suggestions
- if its only keyboard focus you easily can catch it with WM_SETFOCUS
WM_SETFOCUS
-if you want mouse focus you can use a variable for the status of the app and when
WM_KILLFOCUS is fired you will know when your app is not in focus and use it combined with WM_MOUSEMOVE
WM_MOUSEMOVE
(i would use MK_LBUTTON) and the variable for the status to determine if your app is in focus again
-if its both keyboard and mouse focus you just can combine the previous solutions
I hope this helps
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900