pOwnerItem (POWNERITEM)

      Pointer to an OWNERITEM data structure.

      The following list defines the OWNERITEM data structure fields as they apply to the container control. See OWNERITEM for the default field values.

      hwnd (HWND)

        Handle of the window in which ownerdraw will occur. The following is a list of the window handles that can be specified for ownerdraw:

        • The container window handle of the icon, name, text, and tree views
        • The container title window handle
        • The left or right window handles of the details view
        • The left or right column heading windows of the details view.
        hps (HPS)
          Handle of the presentation space of the container window. For the details view that uses a split bar, the presentation space handle is either for the left or right window, depending upon the position of the column. If the details view does not have a split bar, the presentation space handle is for the left window.
        fsState (ULONG)
          Specifies emphasis flags. This state is not used by the container control because the application is responsible for drawing the emphasis states during ownerdraw.
        fsAttribute (ULONG)
          Attributes of the record as given in the flRecordAttr field in the RECORDCORE data structure.

          Note: If the CCS_MINIRECORDCORE style bit is specified when a container is created, then MINIRECORDCORE should be used instead of RECORDCORE and PMINIRECORDCORE should be used instead of PRECORDCORE in all applicable data structures and messages.

        fsStateOld (ULONG)
          Previous emphasis. This state is not used by the container control because the application is responsible for drawing the emphasis states during ownerdraw.
        fsAttributeOld (ULONG)
          Previous attribute. This state is not used by the container control because the application is responsible for drawing the emphasis states during ownerdraw.
        rclItem (RECTL)
          This is the bounding rectangle into which the container item is drawn.

          If the container item is an icon/text or bit-map/text pair, two WM_DRAWITEM messages are sent to the application. The first WM_DRAWITEM message contains the rectangle bounding the icon or bit map and the second contains the rectangle bounding the text.

          If the container item contains only text, or only an icon or bit map, only one WM_DRAWITEM message is sent. However, if the current view is the tree icon or tree text view and if the item is a parent item, the application will receive an additional WM_DRAWITEM (in Container Controls) message. The additional message is for the icon or bit map that indicates whether the parent item is expanded or collapsed.

          If the current view is the details view and the CFA_OWNER attribute is set, the rectangle's size is equal to the width of the column and the height of the tallest field in the container item. CFA_OWNER is an attribute of the FIELDINFO data structure's flData field.

        idItem (ULONG)
          Identifies the item being drawn. It can be one of the following:

          • CMA_CNRTITLE
          • CMA_ICON
          • CMA_TEXT
          • CMA_TREEICON.
          This field is not used for the details view and is set to 0.
        hItem (CNRDRAWITEMINFO)
          Pointer to a CNRDRAWITEMINFO structure.


        [Back] [Next]