如何限制可调整大小的窗口的分辨率?

时间:2017-02-04 03:10:08

标签: c# unity3d resize window pc

在构建窗口中,我将游戏的可调整大小的窗口设置为:https://i.stack.imgur.com/bC3oW.png

如何调整此可调整大小窗口的分辨率(例如,如果分辨率低于1280 * 720,它将停止调整大小)?

1 个答案:

答案 0 :(得分:0)

实际上,它可以使用以下方法来解决但不完美:

//to change the size and pos
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int MoveWindow(IntPtr hWnd, int x, int y, int nWidth, int nHeight, bool BRePaint);

//to get the Window Handle
[DllImport("User32.dll", EntryPoint = "FindWindow")]
public extern static IntPtr FindWindow(string lpClassName, string lpWindowName);

最后一个未解决的问题是我可以获得此Window Handle的当前位置,它将始终设置在(x,y)的位置