在 Windows 中检测全屏模式 [英] Detecting full screen mode in Windows

查看:37
本文介绍了在 Windows 中检测全屏模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检测某个应用程序当前是否在全屏模式下运行.如果是,那么我必须停止我的申请.那么,我怎样才能检测到呢?附言Win32 C++

I need to detect if some application is currently running in full screen mode. If yes, then I must stop my application. So, how can I detect that? p.s. Win32 C++

推荐答案

hWnd = GetForegroundWindow();
RECT appBounds;
RECT rc;
GetWindowRect(GetDesktopWindow(), &rc);

然后检查该窗口是否不是桌面或外壳.简单的 if 指令.

Then check if that windows isn't desktop or shell. Simple if instruction.

if(hWnd =! GetDesktopWindow() && hWnd != GetShellWindow())
{
    GetWindowRect(hWnd, &appBounds);
    // Now you just have to compare rc to appBounds
}

这是在没有测试的情况下编写的.

This is written without testing.

这篇关于在 Windows 中检测全屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆