using System; using System.Drawing; using System.Runtime.InteropServices; using static Vanara.PInvoke.User32; namespace Vanara.PInvoke { /// Contains structures, enumerations and functions from COMCTL32.DLL. public static partial class ComCtl32 { /// Used in the structure himl member to indicate that no glyph should be displayed. public static IntPtr BCCL_NOGLYPH = new IntPtr(-1); /// Used by the member to specify alignment. [PInvokeData("Commctrl.h", MSDNShortId = "bb775953")] public enum ButtonImageListAlign { /// Align the image with the left margin. BUTTON_IMAGELIST_ALIGN_LEFT = 0, /// Align the image with the right margin. BUTTON_IMAGELIST_ALIGN_RIGHT = 1, /// Align the image with the top margin. BUTTON_IMAGELIST_ALIGN_TOP = 2, /// Align the image with the bottom margin. BUTTON_IMAGELIST_ALIGN_BOTTOM = 3, /// Center the image. BUTTON_IMAGELIST_ALIGN_CENTER = 4 // Doesn't draw text } /// /// A set of flags that specify which members of contain data to be set or which members are being requested. /// [PInvokeData("Commctrl.h", MSDNShortId = "bb775955")] [Flags] public enum SplitButtonInfoMask { /// himlGlyph is valid. BCSIF_GLYPH = 0x1, /// himlGlyph is valid. Use when uSplitStyle is set to BCSS_IMAGE. BCSIF_IMAGE = 0x2, /// uSplitStyle is valid. BCSIF_STYLE = 0x4, /// size is valid. BCSIF_SIZE = 0x8 } /// The split button style for the uSplitStyle member of . [PInvokeData("Commctrl.h", MSDNShortId = "bb775955")] [Flags] public enum SplitButtonInfoStyle { /// No split. BCSS_NOSPLIT = 0x1, /// Stretch glyph, but try to retain aspect ratio. BCSS_STRETCH = 0x2, /// Align the image or glyph horizontally with the left margin. BCSS_ALIGNLEFT = 0x4, /// Draw an icon image as the glyph. BCSS_IMAGE = 0x8 } /// Contains information about an image list that is used with a button control. [PInvokeData("Commctrl.h", MSDNShortId = "bb775953")] [StructLayout(LayoutKind.Sequential)] public struct BUTTON_IMAGELIST { /// /// A handle to the image list. The provider retains ownership of the image list and is ultimately responsible for its disposal. /// Under Windows Vista, you can pass BCCL_NOGLYPH in this parameter to indicate that no glyph should be displayed. /// public HIMAGELIST himl; /// A RECT that specifies the margin around the icon. public RECT margin; /// A UINT that specifies the alignment to use. public ButtonImageListAlign uAlign; } /// /// Contains information that defines a split button (BS_SPLITBUTTON and BS_DEFSPLITBUTTON styles). Used with the BCM_GETSPLITINFO /// and BCM_SETSPLITINFO messages. /// [PInvokeData("Commctrl.h", MSDNShortId = "bb775955")] [StructLayout(LayoutKind.Sequential)] public struct BUTTON_SPLITINFO { /// /// A set of flags that specify which members of this structure contain data to be set or which members are being requested. /// public SplitButtonInfoMask mask; /// /// A handle to the image list. The provider retains ownership of the image list and is ultimately responsible for its disposal. /// public HIMAGELIST himlGlyph; /// The split button style. public SplitButtonInfoStyle uSplitButtonInfoStyle; /// A SIZE structure that specifies the size of the glyph in himlGlyph. public Size size; /// Initializes a new instance of the struct and sets the uSplitStyle value. /// The style. public BUTTON_SPLITINFO(SplitButtonInfoStyle buttonInfoStyle) : this() { uSplitButtonInfoStyle = buttonInfoStyle; mask = SplitButtonInfoMask.BCSIF_STYLE; } /// Initializes a new instance of the struct and sets an ImageList /// The h image list. public BUTTON_SPLITINFO(HIMAGELIST hImageList) : this() { himlGlyph = hImageList; mask = SplitButtonInfoMask.BCSIF_IMAGE; } } /// Contains information about a BCN_DROPDOWN notification. [PInvokeData("Commctrl.h", MSDNShortId = "bb775957")] [StructLayout(LayoutKind.Sequential)] public struct NMBCDROPDOWN { /// An NMHDR structure containing information about the notification. public NMHDR hdr; /// A RECT structure that contains the client area of the button. public RECT rcButton; } /// Contains information about the movement of the mouse over a button control. [PInvokeData("Commctrl.h", MSDNShortId = "bb775959")] [StructLayout(LayoutKind.Sequential)] public struct NMBCHOTITEM { /// An NMHDR structure. public NMHDR hdr; /// The action of the mouse. This parameter can be one of the following values combined with HICF_MOUSE. public HotItemChangeFlags dwFlags; } } }