2017-02-04 68 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)

相關問題