Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DRAWITEMSTRUCT Structure
                                              Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  typedef struct tagDRAWITEMSTRUCT {
      WORD   CtlType;
      WORD   CtlID;
      WORD   itemID;
      WORD   itemAction;
      WORD   itemState;
      HWND   hwndItem;
      HDC    hDC;
      RECT   rcItem;
      DWORD  itemData;
  } DRAWITEMSTRUCT;
 
  Member       Description
 
  CtlType      Is the control type. The values for control types are as
               follows:
 
               Value          Meaning
 
               ODT_BUTTON     Owner-draw button.
 
               ODT_COMBOBOX   Owner-draw combo box.
 
               ODT_LISTBOX    Owner-draw list box.
 
               ODT_MENU       Owner-draw menu.
 
  CtlID        Is the control ID for a combo box, list box or button. This
               member is not used for a menu.
 
  itemID       Is the menu-item ID for a menu 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 input focus. The setting of the bits in the
               itemAction member determines whether the rectangle is to be
               drawn as though the list box or combo box has input focus.
 
  itemAction   Defines the drawing action required. This will be one or
               more of the following bits:
 
               Value            Meaning
 
               ODA_DRAWENTIRE   This bit is set when the entire control
                                needs to be drawn.
 
               ODA_FOCUS        This bit is set when the control gains or
                                loses input focus. The itemState member
                                should be checked to determine whether the
                                control has focus.
 
               ODA_SELECT       This bit is set when only the selection
                                status has changed. The itemState member
                                should be checked to determine the new
                                selection state.
 
  itemState    Specifies the visual state of the item after the current
               drawing action takes place. That is, if a menu item is to
               be grayed, the state flag ODS_GRAYED will be set. The state
               flags are:
 
               Value          Meaning
 
               ODS_CHECKED    This bit is set if the menu item is to be
                              checked. This bit is used only in a menu.
 
               ODS_DISABLED   This bit is set if the item is to be drawn
                              as disabled.
 
               ODS_FOCUS      This bit is set if the item has input
                              focus.
 
               ODS_GRAYED     This bit is set if the item is to be grayed.
                              This bit is used only in a menu.
 
               ODS_SELECTED   This bit is set if the item's status is
                              selected.
 
  hwndItem     For combo boxes, list boxes and buttons, this member
               specifies the window handle of the control; for menus, it
               contains the handle of the menu (HMENU) containing the
               item.
 
  hDC          Identifies a device context; this device context must be
               used when performing drawing operations on the control.
 
  rcItem       Is a rectangle in the device context specified by the hDC
               member that defines the boundaries of the control to be
               drawn. Windows automatically clips anything the owner draws
               in the device context for combo boxes, list boxes, and
               buttons, but does not clip menu items. When drawing menu
               items, the owner must ensure that the owner does not draw
               outside the boundaries of the rectangle defined by the
               rcItem member.
 
  itemData     For a combo box or list box, this member contains the value
               that was passed by one of the following:
 
                   CComboBox::AddString
                   CComboBox::InsertString
                   CListBox::AddString
                   CListBox::InsertString
 
 
                                     -♦-