typedef struct tagMEASUREITEMSTRUCT { /* mi */
UINT CtlType;
UINT CtlID;
UINT itemID;
UINT itemWidth;
UINT itemHeight;
DWORD itemData;
} MEASUREITEMSTRUCT;
The MEASUREITEMSTRUCT structure informs Windows of the dimensions of an owner-drawn control. This allows Windows to process user interaction with the control correctly. The owner of an owner-drawn control receives a pointer to this structure as the lParam parameter of an WM_MEASUREITEM message. The owner-drawn control sends this message to its owner window when the control is created. The owner then fills in the appropriate members in the structure for the control and returns. This structure is common to all owner-drawn controls.
CtlType
Specifies the control type. The values for control types are as follows:
Value | Meaning |
ODT_BUTTON | Owner-drawn button |
ODT_COMBOBOX | Owner-drawn combo box |
ODT_LISTBOX | Owner-drawn list box |
ODT_MENU | Owner-drawn menu |
CtlID
Specifies the control identifier for a combo box, list box, or button. This member is not used for a menu.
itemID
Specifies the menu-item identifier for a menu or the list-box item identifier for a variable-height combo box or list box. This member is not used for a fixed-height combo box or list box or for a button.
itemWidth
Specifies the width of a menu item. The owner of the owner-drawn menu item must fill this member before returning from the message.
itemHeight
Specifies the height of an individual item in a list box or a menu. Before returning from the message, the owner of the owner-drawn combo box, list box, or menu item must fill out this member. The maximum height of a list box item is 255.
itemData
Contains the value that was passed to the combo box or list box in the lParam parameter of one of the following messages:
CB_ADDSTRING CB_INSERTSTRING LB_ADDSTRING LB_INSERTSTRING
Failure to fill out the proper members in the MEASUREITEMSTRUCT structure will cause improper operation of the control.