[英]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.