Binarysharp.MemoryManagement.Windows.WindowCore.GetWindowPlacement C# (CSharp) Method

GetWindowPlacement() public static method

Retrieves the show state and the restored, minimized, and maximized positions of the specified window.
public static GetWindowPlacement ( IntPtr windowHandle ) : WindowPlacement
windowHandle System.IntPtr A handle to the window.
return Binarysharp.MemoryManagement.Native.WindowPlacement
        public static WindowPlacement GetWindowPlacement(IntPtr windowHandle)
        {
            // Check if the handle is valid
            HandleManipulator.ValidateAsArgument(windowHandle, "windowHandle");

            // Allocate a WindowPlacement structure
            WindowPlacement placement;
            placement.Length = Marshal.SizeOf(typeof(WindowPlacement));

            // Get the window placement
            if (!NativeMethods.GetWindowPlacement(windowHandle, out placement))
                throw new Win32Exception("Couldn't get the window placement.");

            return placement;
        }