有没有一种方法来检查是否有其他程序正在运行全屏

编程入门 行业动态 更新时间:2024-10-26 06:30:55
本文介绍了有没有一种方法来检查是否有其他程序正在运行全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

就像问题如是说。我可以看看别人,程序运行时全屏?

Just like the question says. Can I see if someone else, program, is running full screen?

全屏意味着整个画面模糊,在不同的视频模式比台式机可能会运行。

Full screen means that the entire screen is obscured, possibly running in a different video mode than the desktop.

推荐答案

下面是一些代码,做的。你要照顾有关多屏情况下,特别是如PowerPoint

Here is some code that does it. You want to take care about the multi screen case, especially with applications like Powerpoint

[StructLayout(LayoutKind.Sequential)] private struct RECT { public int left; public int top; public int right; public int bottom; } [DllImport("user32.dll")] private static extern bool GetWindowRect(HandleRef hWnd, [In, Out] ref RECT rect); [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); public static bool IsForegroundFullScreen() { return IsForegroundFullScreen(null); } public static bool IsForegroundFullScreen(Screen screen) { if (screen == null) { screen = Screen.PrimaryScreen; } RECT rect = new RECT(); GetWindowRect(new HandleRef(null, GetForegroundWindow()), ref rect); return new Rectangle(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top).Contains(screen.Bounds); }

更多推荐

有没有一种方法来检查是否有其他程序正在运行全屏

本文发布于:2023-11-23 19:33:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622629.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:全屏   方法来   正在运行   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!