2017-02-04 65 views

回答

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

最后一个尚未解决的问题是我能得到这个窗口句柄的当前位置,它总是会在(x的位置设置,y)

相关问题