本文介绍了有没有一种方法来检查是否有其他程序正在运行全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
就像问题如是说。我可以看看别人,程序运行时全屏?
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); }更多推荐
有没有一种方法来检查是否有其他程序正在运行全屏
发布评论