Follow a possible solution:
[DllImport("user32.dll")]
static extern IntPtr GetForegroundWindow();
public static extern bool GetWindowRect(IntPtr hwnd, refRect rectangle);
[DllImport("user32.dll", SetLastError = true)]
static extern bool MoveWindow(IntPtr hWnd, int X, int Y, intnWidth, int nHeight, bool bRepaint);
public struct Rect {
publicint Left { get; set; }
publicint Top { get; set; }
publicint Right { get; set; }
publicint Bottom { get; set; }
}
public MainControl() {
InitializeComponent();
IntPtrh = GetForegroundWindow();
Rect r= new Rect();
GetWindowRect(h,ref r);
MoveWindow(h,r.Right, r.Left, 800, 600, true);
...