简体   繁体   English

游戏是全屏还是窗口?

[英]Is A Game Fullscreen Or Windowed?

Is there anyway to know if a certain game is running on full screen or running as a window?无论如何要知道某个游戏是全屏运行还是作为 window 运行?

I need this because my application is for a game that can toggle between fullscreen and window mode and I need to act differently to each situation.我需要这个,因为我的应用程序是用于可以在全屏和 window 模式之间切换的游戏,我需要针对每种情况采取不同的行动。

something like:就像是:

if (Fullscreen) {Act For Fullscreen} else {Act For Window Mode}

*The game isn't mine, it's another game. *这个游戏不是我的,它是另一个游戏。 A real game.一个真正的游戏。

I assume that game is not written by you.我想那游戏不是你写的。 You can use Win32 api http://www.pinvoke.net/default.aspx/user32.GetWindowPlacement您可以使用 Win32 api http://www.pinvoke.net/default.aspx/user32.GetWindowPlacement

won't this do?这不行吗?

if(WindowState == WindowState.Maximized)

It will probably depend on specific graphics technology you will be using rather than on WinForms API.它可能取决于您将使用的特定图形技术,而不是 WinForms API。

For example XNA (DirectX):例如 XNA (DirectX):

GraphicsDeviceManager graphics = new GraphicsDeviceManager(...); 

graphics.IsFullScreen = true; 

Have you looked at the WindowState and FormWindowState enumeration?你看过WindowStateFormWindowState枚举吗?

http://msdn.microsoft.com/en-us/library/system.windows.forms.formwindowstate.aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.formwindowstate.aspx

A Full Screen application is a maximized window without borders. Full Screen应用程序是一个没有边框的最大化 window。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM