Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
WINDOWPLACEMENT (Structures)
 
.
Summary
The WINDOWPLACEMENT structure contains information about the placement of a window on the screen.

C# Definition:

/// <summary>
/// Contains information about the placement of a window on the screen.
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential)]
internal struct WINDOWPLACEMENT
{
     /// <summary>
     /// The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT).
     /// <para>
     /// GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.
     /// </para>
     /// </summary>
     public int Length;

     /// <summary>
     /// Specifies flags that control the position of the minimized window and the method by which the window is restored.
     /// </summary>
     public int Flags;

     /// <summary>
     /// The current show state of the window.
     /// </summary>
     public ShowWindowCommands ShowCmd;

     /// <summary>
     /// The coordinates of the window's upper-left corner when the window is minimized.
     /// </summary>
     public POINT MinPosition;

     /// <summary>
     /// The coordinates of the window's upper-left corner when the window is maximized.
     /// </summary>
     public POINT MaxPosition;

     /// <summary>
     /// The window's coordinates when the window is in the restored position.
     /// </summary>
     public RECT NormalPosition;

     /// <summary>
     /// Gets the default (empty) value.
     /// </summary>
     public static WINDOWPLACEMENT Default
     {
         get
         {
             WINDOWPLACEMENT result = new WINDOWPLACEMENT();
             result.Length = Marshal.SizeOf( result );
             return result;
         }
     }    
}

VB.NET Definition:

<StructLayout(LayoutKind.Sequential)> _
Private Structure WINDOWPLACEMENT
     Public length As Integer
     Public flags As Integer
     Public showCmd As ShowWindowCommand
     Public minPosition As POINT
     Public maxPosition As POINT
     Public normalPosition As RECT
End Structure

VB Definition

Public Type WINDOWPLACEMENT
     Length As Long
     Flags As Long
     ShowCmd As Long
     ptMinPosition As POINT
     ptMaxPosition As POINT
     rcNormalPosition As RECT
End Type

User-Defined Types:

POINT, RECT, ShowWindowCommands

Notes:

Use with GetWindowPlacement and SetWindowPlacement

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions