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
Download Visual Studio Add-In

TITLEBARINFO (Structures)
 
.
Summary
The TITLEBARINFO structure contains title bar information.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
struct TITLEBARINFO
{
    public const int CCHILDREN_TITLEBAR = 5;
    public uint cbSize;
    public RECT rcTitleBar;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst=CCHILDREN_TITLEBAR+1)]
    public uint[] rgstate;
    public uint rgstate;
}

VB Definition:

<StructLayout(LayoutKind.Sequential)> _
Structure TITLEBARINFO
   Public cbSize As Int32
   Public rcTitleBar As Rect
   Public rgState As TitleBarButtonStates
End Structure

User-Defined Field Types:

VB User-Defined Field Types:

<StructLayout(LayoutKind.Sequential)> _
Structure Rect
   Public Left, Top, Right, Bottom As Int32
   Public Function ToRectangle() As Rectangle
     Return Rectangle.FromLTRB(Left, Top, Right, Bottom)
   End Function
   Public Overrides Function ToString() As String
     Return "Rect: " & ToRectangle.ToString
   End Function
End Structure

<StructLayout(LayoutKind.Sequential)> _
Structure TitleBarButtonStates
   Public TitleBarState As TBBStates
   Public Reserved As TBBStates
   Public MinState As TBBStates
   Public MaxState As TBBStates
   Public HelpState As TBBStates
   Public CloseState As TBBStates
End Structure

Enum TBBStates
   STATE_SYSTEM_UNAVAILABLE = &H1
   STATE_SYSTEM_PRESSED = &H8
   STATE_SYSTEM_INVISIBLE = &H8000
   STATE_SYSTEM_OFFSCREEN = &H10000
   STATE_SYSTEM_FOCUSABLE = &H100000
End Enum

Notes:

Example Code

public Class Win32

{

        [StructLayout(LayoutKind.Sequential)]
        public    struct TITLEBARINFO
        {
            public const int CCHILDREN_TITLEBAR = 5;
            public uint cbSize;
            public RECT rcTitleBar;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst=CCHILDREN_TITLEBAR+1)]
            public uint[] rgstate;
        }

None.

        [DllImport("User32.dll", CharSet = CharSet.Auto)]
        public static extern bool GetTitleBarInfo(IntPtr hwnd, ref TITLEBARINFO pti);

}

private void Form_Load(object sender, System.EventArgs e)

{

    Win32.TITLEBARINFO pti = new Win32.TITLEBARINFO();
    pti.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(pti);
    bool result = Win32.GetTitleBarInfo(Handle, ref pti);

}

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