繁体   English   中英

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

[英]how to restrict the resolution of a resizable window?

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

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

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

//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);

最后一个未解决的点是我可以获取此窗口句柄的当前位置,它将始终设置在(x,y)的位置

暂无
暂无

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

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