diff --git a/PInvoke/ComCtl32/CommCtrl.Toolbar.cs b/PInvoke/ComCtl32/CommCtrl.Toolbar.cs index 33511db2..5289bb32 100644 --- a/PInvoke/ComCtl32/CommCtrl.Toolbar.cs +++ b/PInvoke/ComCtl32/CommCtrl.Toolbar.cs @@ -4001,5 +4001,99 @@ namespace Vanara.PInvoke [MarshalAs(UnmanagedType.LPTStr)] public string pszValueName; } + + /// Contains information specific to an NM_CUSTOMDRAW notification code sent by a toolbar control. + // typedef struct { NMCUSTOMDRAW nmcd; HBRUSH hbrMonoDither; HBRUSH hbrLines; HPEN hpenLines; COLORREF clrText; COLORREF clrMark; + // COLORREF clrTextHighlight; COLORREF clrBtnFace; COLORREF clrBtnHighlight; COLORREF clrHighlightHotTrack; + // RECT rcText; int nStringBkMode; int nHLStringBkMode; int iListGap;} NMTBCUSTOMDRAW; + // https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmtbcustomdraw + [PInvokeData("Commctrl.h")] + [StructLayout(LayoutKind.Sequential)] + public struct NMTBCUSTOMDRAW + { + /// + /// Type: NMCUSTOMDRAW + /// NMCUSTOMDRAW structure that contains general custom draw information. The uItemState member of this structure can be modified so that a toolbar item will be drawn in the specified state without actually changing the item's state. + /// + public NMCUSTOMDRAW nmcd; + + /// + /// Type: HBRUSH + /// HBRUSH that the control will use when drawing the background of marked or dithered items. This member is ignored if TBCDRF_NOMARK is returned from the NM_CUSTOMDRAW notification code. + /// + public HBRUSH hbrMonoDither; + + /// + /// Type: HBRUSH + /// HBRUSH that the control will use when drawing lines on the buttons. + /// + public HBRUSH hbrLines; + + /// + /// Type: HPEN + /// HPEN that the control will use when drawing lines on the buttons. + /// + public HPEN hpenLines; + + /// + /// Type: COLORREF + /// COLORREF that represents the color that the control will use when drawing text on normal items. + /// + public COLORREF clrText; + + /// + /// Type: COLORREF + /// COLORREF that represents the background color that the control will use when drawing text on marked items. + /// + public COLORREF clrMark; + + /// + /// Type: COLORREF + /// COLORREF that represents the color that the control will use when drawing text on highlighted items. + /// + public COLORREF clrTextHighlight; + + /// + /// Type: COLORREF + /// COLORREF that represents the face color that the control will use when drawing buttons. + /// + public COLORREF clrBtnFace; + + /// + /// Type: COLORREF + /// COLORREF that represents the face color that the control will use when drawing highlighted items. An item is highlighted if it has the TBSTATE_MARKED style and is contained in a toolbar that has the TBSTYLE_FLAT style. + /// + public COLORREF clrBtnHighlight; + + /// + /// Type: COLORREF + /// COLORREF that represents the background color that the control will use when drawing text on hot tracked items. This member is ignored if TBCDRF_HILITEHOTTRACK is not returned from the NM_CUSTOMDRAW notification code. + /// + public COLORREF clrHighlightHotTrack; + + /// + /// Type: RECT + /// RECT structure that, on entry, contains the rectangle of the item's text. The right and bottom members of this structure can be modified to change the width and height, respectively, of the text rectangle of the item. + /// + public RECT rcText; + + /// + /// Type: int + /// Background mode that the control will use when drawing the text of a nonhighlighted item. This can be either the TRANSPARENT or OPAQUE value. + /// + public int nStringBkMode; + + /// + /// Type: int + /// Background mode that the control will use when drawing the text of a highlighted item. This can be either the TRANSPARENT or OPAQUE value. + /// + public int nHLStringBkMode; + + /// + /// Type: int + /// Version 6.0 Specifies the distance between the toolbar button image and the text, in logical pixels, for toolbars that have TBSTYLE_LIST style set. + /// + public int iListGap; + } } } \ No newline at end of file