积极答复者
窗口是否在屏幕最前

问题
答案
-
GetForegroundWindow()试试,如果不行的话,您可以试试EnumWindows来枚举窗口,窗口顺序是按照Z-Order来排列的,看看您自己的窗口是否在最前面。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
- 已编辑 VisualElevenModerator 2015年3月13日 10:47
- 已标记为答案 dream99 2015年3月14日 4:20
全部回复
-
怎么定义屏幕最前?比如说窗口是否active,你的软件的窗口框架如果是active的应该就是最前的吧。
GetActiveWindow 这个函数符合你的需求吗。
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646292(v=vs.85).aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
你是想让你的软件能够自己监测自己是否激活具有焦点吗,考虑处理WM_ACTIVATE消息。最好描述一下你要的情景的逻辑。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
GetForegroundWindow()试试,如果不行的话,您可以试试EnumWindows来枚举窗口,窗口顺序是按照Z-Order来排列的,看看您自己的窗口是否在最前面。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
- 已编辑 VisualElevenModerator 2015年3月13日 10:47
- 已标记为答案 dream99 2015年3月14日 4:20