如何申请变更事件 [英] How to application change event
本文介绍了如何申请变更事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么办法可以知道应用程序更改事件吗?
即,我在MFC功能包中有一个应用程序.
在另一个应用程序中完成某些工作之后,当用户切换回我的应用程序时,我需要更新CView.
希望您理解我的问题???
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???
推荐答案
您好,我不确定您要关注的重点是什么,但这是我的建议
-如果仅是键盘焦点,则可以轻松地通过WM_SETFOCUS进行捕捉
WM_SETFOCUS
-如果您希望将鼠标放在焦点上,则可以在应用程序的状态以及何时使用
变量 WM_KILLFOCUS被解雇后,您将知道您的应用程序何时未聚焦,并将其与WM_MOUSEMOVE结合使用
WM_MOUSEMOVE
(我将使用MK_LBUTTON)和状态变量来确定您的应用是否再次成为焦点
-如果同时兼顾键盘和鼠标,则可以结合以前的解决方案
希望对您有帮助
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
这篇关于如何申请变更事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文