/// <summary> /// Gets the window placement. /// </summary> /// <param name="hwnd">The HWND.</param> /// <returns>WINDOWPLACEMENT.</returns> /// <exception cref="System.ComponentModel.Win32Exception"></exception> public static WINDOWPLACEMENT GetWindowPlacement(IntPtr hwnd) { WINDOWPLACEMENT wINDOWPLACEMENT = new WINDOWPLACEMENT(); if (!NativeMethods.GetWindowPlacement(hwnd, out wINDOWPLACEMENT)) { throw new Win32Exception(Marshal.GetLastWin32Error()); } else { return wINDOWPLACEMENT; } }
public static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);