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