public static extern bool GetWindowPlacement(IntPtr window, ref WindowPlacement position);
public static WindowPlacement GetWindowPlacement(IntPtr hWnd) { WindowPlacement wplc = new WindowPlacement(); if (!Api_User32.GetWindowPlacement(hWnd, ref wplc)) throw new Win32Exception(Marshal.GetLastWin32Error(), "An error occured trying to obtain window placement information."); return wplc; }