using System;
namespace Vanara.PInvoke
{
public static partial class User32
{
///
public const int CBEN_FIRST = -800;
///
public const int CBM_FIRST = 0x1700;
/// Contains combo box status information.
[PInvokeData("Winuser.h", MSDNShortId = "bb775798")]
[Flags]
public enum ComboBoxInfoState
{
/// The button exists and is not pressed.
None = 0,
/// There is no button.
STATE_SYSTEM_INVISIBLE = 0x00008000,
/// The button is pressed.
STATE_SYSTEM_PRESSED = 0x00000008
}
/// Windows messages for combo-boxes.
public enum ComboBoxMessage
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
CB_GETEDITSEL = 0x0140,
CB_LIMITTEXT = 0x0141,
CB_SETEDITSEL = 0x0142,
CB_ADDSTRING = 0x0143,
CB_DELETESTRING = 0x0144,
CB_DIR = 0x0145,
CB_GETCOUNT = 0x0146,
CB_GETCURSEL = 0x0147,
CB_GETLBTEXT = 0x0148,
CB_GETLBTEXTLEN = 0x0149,
CB_INSERTSTRING = 0x014A,
CB_RESETCONTENT = 0x014B,
CB_FINDSTRING = 0x014C,
CB_SELECTSTRING = 0x014D,
CB_SETCURSEL = 0x014E,
CB_SHOWDROPDOWN = 0x014F,
CB_GETITEMDATA = 0x0150,
CB_SETITEMDATA = 0x0151,
CB_GETDROPPEDCONTROLRECT = 0x0152,
CB_SETITEMHEIGHT = 0x0153,
CB_GETITEMHEIGHT = 0x0154,
CB_SETEXTENDEDUI = 0x0155,
CB_GETEXTENDEDUI = 0x0156,
CB_GETDROPPEDSTATE = 0x0157,
CB_FINDSTRINGEXACT = 0x0158,
CB_SETLOCALE = 0x0159,
CB_GETLOCALE = 0x015A,
CB_GETTOPINDEX = 0x015b,
CB_SETTOPINDEX = 0x015c,
CB_GETHORIZONTALEXTENT = 0x015d,
CB_SETHORIZONTALEXTENT = 0x015e,
CB_GETDROPPEDWIDTH = 0x015f,
CB_SETDROPPEDWIDTH = 0x0160,
CB_INITSTORAGE = 0x0161,
CB_MULTIPLEADDSTRING = 0x0163,
CB_GETCOMBOBOXINFO = 0x0164,
CB_SETMINVISIBLE = CBM_FIRST + 1,
CB_GETMINVISIBLE = CBM_FIRST + 2,
CB_SETCUEBANNER = CBM_FIRST + 3,
CB_GETCUEBANNER = CBM_FIRST + 4,
CBEM_SETIMAGELIST = WindowMessage.WM_USER + 2,
CBEM_GETIMAGELIST = WindowMessage.WM_USER + 3,
CBEM_DELETEITEM = CB_DELETESTRING,
CBEM_GETCOMBOCONTROL = WindowMessage.WM_USER + 6,
CBEM_GETEDITCONTROL = WindowMessage.WM_USER + 7,
CBEM_SETEXSTYLE = WindowMessage.WM_USER + 8, // use SETEXTENDEDSTYLE instead
CBEM_SETEXTENDEDSTYLE = WindowMessage.WM_USER + 14, // lparam == new style, wParam (optional) == mask
CBEM_GETEXSTYLE = WindowMessage.WM_USER + 9, // use GETEXTENDEDSTYLE instead
CBEM_GETEXTENDEDSTYLE = WindowMessage.WM_USER + 9,
CBEM_SETUNICODEFORMAT = 0x2005,
CBEM_GETUNICODEFORMAT = 0x2006,
CBEM_HASEDITCHANGED = WindowMessage.WM_USER + 10,
CBEM_INSERTITEM = WindowMessage.WM_USER + 11,
CBEM_SETITEM = WindowMessage.WM_USER + 12,
CBEM_GETITEM = WindowMessage.WM_USER + 13,
CBEM_SETWINDOWTHEME = 0x200B,
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
/// Combo Box Notification Codes
[PInvokeData("Winuser.h", MSDNShortId = "ff485902")]
public enum ComboBoxNotification
{
///
/// Sent when a combo box cannot allocate enough memory to meet a specific request. The parent window of the combo box receives
/// this notification code through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_ERRSPACE = (-1),
///
/// Sent when the user changes the current selection in the list box of a combo box. The user can change the selection by
/// clicking in the list box or by using the arrow keys. The parent window of the combo box receives this notification code in
/// the form of a WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_SELCHANGE = 1,
///
/// Sent when the user double-clicks a string in the list box of a combo box. The parent window of the combo box receives this
/// notification code through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_DBLCLK = 2,
///
/// Sent when a combo box receives the keyboard focus. The parent window of the combo box receives this notification code through
/// the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_SETFOCUS = 3,
///
/// Sent when a combo box loses the keyboard focus. The parent window of the combo box receives this notification code through
/// the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_KILLFOCUS = 4,
///
/// Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box. Unlike the
/// CBN_EDITUPDATE notification code, this notification code is sent after the system updates the screen. The parent window of
/// the combo box receives this notification code through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_EDITCHANGE = 5,
///
/// Sent when the edit control portion of a combo box is about to display altered text. This notification code is sent after the
/// control has formatted the text, but before it displays the text. The parent window of the combo box receives this
/// notification code through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_EDITUPDATE = 6,
///
/// Sent when the list box of a combo box is about to be made visible. The parent window of the combo box receives this
/// notification code through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_DROPDOWN = 7,
///
/// Sent when the list box of a combo box has been closed. The parent window of the combo box receives this notification code
/// through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_CLOSEUP = 8,
///
/// Sent when the user selects a list item, or selects an item and then closes the list. It indicates that the user's selection
/// is to be processed. The parent window of the combo box receives this notification code through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_SELENDOK = 9,
///
/// Sent when the user selects an item, but then selects another control or closes the dialog box. It indicates the user's
/// initial selection is to be ignored. The parent window of the combo box receives this notification code through the WM_COMMAND message.
///
/// -
/// wParam
/// The LOWORD contains the control identifier of the combo box. The HIWORD specifies the notification code.
///
/// -
/// lParam
/// Handle to the combo box.
///
///
///
CBN_SELENDCANCEL = 10,
///
/// Sent when a new item has been inserted in the control. This notification code is sent in the form of a WM_NOTIFY message.
///
/// -
/// lParam
///
/// A pointer to an NMCOMBOBOXEX structure containing information about the notification code and the item that was inserted.
///
///
///
///
CBEN_INSERTITEM = CBEN_FIRST - 1,
///
/// Sent when an item has been deleted. This notification code is sent in the form of a WM_NOTIFY message.
///
/// -
/// lParam
///
/// A pointer to an NMCOMBOBOXEX structure that contains information about the notification code and the deleted item.
///
///
///
///
CBEN_DELETEITEM = CBEN_FIRST - 2,
///
/// Sent when the user activates the drop-down list or clicks in the control's edit box. This notification code is sent in the
/// form of a WM_NOTIFY message.
///
/// -
/// lParam
///
/// A pointer to an structure that contains information about the notification code.
///
///
///
///
CBEN_BEGINEDIT = CBEN_FIRST - 4,
///
/// Sent when the user has concluded an operation within the edit box or has selected an item from the control's drop-down list.
/// This notification code is sent in the form of a WM_NOTIFY message.
///
/// -
/// lParam
///
/// A pointer to an NMCBEENDEDIT structure that contains information about how the user concluded the edit operation.
///
///
///
///
CBEN_ENDEDITA = CBEN_FIRST - 5,
///
/// Sent when the user has concluded an operation within the edit box or has selected an item from the control's drop-down list.
/// This notification code is sent in the form of a WM_NOTIFY message.
///
/// -
/// lParam
///
/// A pointer to an NMCBEENDEDIT structure that contains information about how the user concluded the edit operation.
///
///
///
///
CBEN_ENDEDITW = CBEN_FIRST - 6,
///
/// Sent to retrieve display information about a callback item. This notification code is sent in the form of a WM_NOTIFY message.
///
/// -
/// lParam
///
/// A pointer to an NMCOMBOBOXEX structure that contains information about the notification code.
///
///
///
///
CBEN_GETDISPINFO = CBEN_FIRST - 7,
///
/// Sent when the user begins dragging the image of the item displayed in the edit portion of the control. This notification code
/// is sent in the form of a WM_NOTIFY message.
///
/// -
/// lParam
///
/// A pointer to a NMCBEDRAGBEGIN structure that contains information about the notification code.
///
///
///
///
CBEN_DRAGBEGIN = CBEN_FIRST - 9,
}
///
/// To create a combo box using the CreateWindow or CreateWindowEx function, specify the COMBOBOX class, appropriate window style
/// constants, and a combination of the following combo box styles.
///
[PInvokeData("CommCtrl.h", MSDNShortId = "bb775796")]
public enum ComboBoxStyle
{
/// Displays the list box at all times. The current selection in the list box is displayed in the edit control.
CBS_SIMPLE = 0x0001,
///
/// Similar to CBS_SIMPLE, except that the list box is not displayed unless the user selects an icon next to the edit control.
///
CBS_DROPDOWN = 0x0002,
///
/// Similar to CBS_DROPDOWN, except that the edit control is replaced by a static text item that displays the current selection
/// in the list box.
///
CBS_DROPDOWNLIST = 0x0003,
///
/// Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are all
/// the same height. The owner window receives a WM_MEASUREITEM message when the combo box is created and a WM_DRAWITEM message
/// when a visual aspect of the combo box has changed.
///
CBS_OWNERDRAWFIXED = 0x0010,
///
/// Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are
/// variable in height. The owner window receives a WM_MEASUREITEM message for each item in the combo box when you create the
/// combo box and a WM_DRAWITEM message when a visual aspect of the combo box has changed.
///
CBS_OWNERDRAWVARIABLE = 0x0020,
///
/// Automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. If
/// this style is not set, only text that fits within the rectangular boundary is allowed.
///
CBS_AUTOHSCROLL = 0x0040,
///
/// Converts text entered in the combo box edit control from the Windows character set to the OEM character set and then back to
/// the Windows character set. This ensures proper character conversion when the application calls the CharToOem function to
/// convert a Windows string in the combo box to OEM characters. This style is most useful for combo boxes that contain file
/// names and applies only to combo boxes created with the CBS_SIMPLE or CBS_DROPDOWN style.
///
CBS_OEMCONVERT = 0x0080,
/// Automatically sorts strings added to the list box.
CBS_SORT = 0x0100,
///
/// Specifies that an owner-drawn combo box contains items consisting of strings. The combo box maintains the memory and address
/// for the strings so the application can use the CB_GETLBTEXT message to retrieve the text for a particular item.
///
CBS_HASSTRINGS = 0x0200,
///
/// Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box.
/// Normally, the system sizes a combo box so that it does not display partial items.
///
CBS_NOINTEGRALHEIGHT = 0x0400,
///
/// Shows a disabled vertical scroll bar in the list box when the box does not contain enough items to scroll. Without this
/// style, the scroll bar is hidden when the list box does not contain enough items.
///
CBS_DISABLENOSCROLL = 0x0800,
/// Converts to uppercase all text in both the selection field and the list.
CBS_UPPERCASE = 0x2000,
/// Converts to lowercase all text in both the selection field and the list.
CBS_LOWERCASE = 0x4000,
}
}
}