The container control enables your application to paint the container's background, draw the container items, or both. If the CA_OWNERPAINTBACKGROUND attribute is set, the container control sends the CM_PAINTBACKGROUND message to itself. Your application can control background painting by subclassing the container control and intercepting the CM_PAINTBACKGROUND message. CA_OWNERPAINTBACKGROUND is an attribute of the CNRINFO data structure's flWindowAttr field.

To support ownerdraw, the drawing of container items by the application, the container control provides the CA_OWNERDRAW attribute of the CNRINFO data structure's flWindowAttr field. If this attribute is set and the application processes the WM_DRAWITEM window message, the application is responsible for drawing each container item, including the types of emphasis.

In addition, the container control supports ownerdraw for each column in the Details view. This support is indicated by the CFA_OWNER attribute, which is specified in the FIELDINFO data structure's flData field.

If the CA_OWNERDRAW attribute or CFA_OWNER attribute is set, the container control sends the application a WM_DRAWITEM message with a pointer to an OWNERITEM data structure as the owneritem parameter.


[Back] [Next]