![]() |
DRAWITEMSTRUCT (API Types) |
www.CAD6.com |
C++ Syntaxstruct DRAWITEMSTRUCT { UINT CtlType; UINT CtlID; UINT itemID; UINT itemAction; UINT itemState; HWND hwndItem; HDC hDC; RECT rcItem; DWORD itemData; };
This structure contains data that identifies a custom control used inside a window or dialog box. This structure is defined in WINDOWS.H.
Element DescriptionCtlType [UINT] Specifies the control type. This member can be one of the following values:
ODT_BUTTON Owner-drawn button.
ODT_COMBOBOX Owner-drawn combo box.
ODT_LISTBOX Owner-drawn list box.
ODT_MENU Owner-drawn menu item.
ODT_STATIC Owner-drawn static control.
This value is ignored by the serving application. CtlID [UINT] Specifies the identifier of the combo box, list box, button, or static control. This member is not used for a menu item. This value is ignored by the serving application. itemID [UINT] Specifies the menu item identifier for a menu item or the index of the item in a list box or combo box. For an empty list box or combo box, this member can be -1. This allows the application to draw only the focus rectangle at the coordinates specified by the rcItem member even though there are no items in the control. This indicates to the user whether the list box or combo box has the focus. How the bits are set in the itemAction member determines whether the rectangle is to be drawn as though the list box or combo box has the focus. This value is ignored by the serving application. itemAction [UINT] Specifies the drawing action required. This member can be one or more of the following values:
ODA_DRAWENTIRE The entire control needs to be drawn.
ODA_FOCUS The control has lost or gained the keyboard focus. The itemState member should be checked to determine whether the control has the focus.
ODA_SELECT The selection status has changed. The itemState member should be checked to determine the new selection state.
This value is ignored by the serving application. itemState [UINT] Specifies the visual state of the item after the current drawing action takes place. This member can be a combination of the following values:
ODS_CHECKED The item is to be checked.
ODS_COMBOBOXEDIT The drawing takes place in the selection field (edit control) of an ownerdrawn combo box.
ODS_DEFAULT The item is the default item.
ODS_DISABLED The item is to be drawn as disabled.
ODS_FOCUS The item has the keyboard focus.
ODS_GRAYED The item is to be grayed.
ODS_SELECTED The menu item's status is selected.
Only the values ODS_CHECKED, ODS_DEFAULT and ODS_DISABLED are recognized by the serving application. hwndItem [HWND] Identifies the control for combo boxes, list boxes, buttons, and static controls. For menus, this member identifies the menu containing the item. This value is ignored by the serving application. hDC [HDC] Identifies a device context (DC); this DC must be used when performing drawing operations on the control. rcItem [RECT] Specifies a rectangle that defines the boundaries of the control to be drawn. This rectangle is in the DC specified by the hDC member. Windows automatically clips anything the owner window draws in the DC for combo boxes, list boxes, and buttons, but does not clip menu items. When drawing menu items, the owner window must not draw outside the boundaries of the rectangle defined by the rcItem member. itemData [DWORD] Specifies the application-defined 32-bit value associated with the menu item. For a control, this parameter specifies the value last assigned to the list box or combo box by the LB_SETITEMDATA or CB_SETITEMDATA message. If the list box or combo box has the LBS_HASSTRINGS or CBS_HASSTRINGS style, this value is initially zero. Otherwise, this value is initially the value that was passed to the list box or combo box in the lParam parameter of one of the following messages:
CB_ADDSTRING CB_INSERTSTRING LB_ADDSTRING LB_INSERTSTRING
If ctlType is ODT_BUTTON or ODT_STATIC, itemData is zero. This value is ignored by the serving application.
MKD SyntaxUnused.
|
CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH