0

In Building window, I set the resizable window of the game like:https://i.stack.imgur.com/bC3oW.png

How can I restrict the resolution of this resizable window when resizing it(for example, if the resolution lower than 1280*720, it will stop the resizing)?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Lemon
  • 3
  • 2

1 Answers1

0

Actually, it can use the follows to solve but not perfect:

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

the last unsolved point is I can get the current position of this Window Handle,it will always set on the position of (x,y)

Lemon
  • 3
  • 2