本文介绍了保持键盘焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确保基于C ++ / MFC对话框的应用程序在运行时保持键盘焦点?我尝试使用SetWindowPos()使主窗口位于最顶层,但是虽然它仍然位于其他窗口的顶部,但如果有人试图激活另一个应用程序,它仍然会失去键盘焦点。我必须点击我的应用程序标题栏才能重新获得键盘焦点。



谢谢



Tony

How can I ensure that my C++/MFC dialog based application keeps keyboard focus when it is running? I have tried making the main window topmost using SetWindowPos() but although it stays on top of other windows, it still looses keyboard focus if someone tries to activate another application. I have to click on my application's title bar to regain keyboard focus.

Thanks

Tony

推荐答案


这篇关于保持键盘焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 06:24