This documentation is archived and is not being maintained.


Creates a list control and attaches it to a CListCtrl object.

virtual BOOL Create(
   DWORD dwStyle,
   const RECT& rect,
   CWnd* pParentWnd,
   UINT nID 



Specifies the list control's style. Apply any combination of list control styles to the control. See List view window styles in the Platform SDK for a complete list of these styles. Set extended styles specific to a control using SetExtendedStyle.


Specifies the list control's size and position. It can be either a CRect object or a RECT structure.


Specifies the list control's parent window, usually a CDialog. It must not be NULL.


Specifies the list control's ID.

Nonzero if successful; otherwise zero.

You construct a CListCtrl in two steps. First, call the constructor and then call Create, which creates the list view control and attaches it to the CListCtrl object.

To apply extended Windows styles to the list control object, call CreateEx instead of Create.

// pParentWnd is a pointer to the parent window.
extern CWnd* pParentWnd;
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;

   CRect(10,10,400,200), pParentWnd, 1);