Share via


CHeaderCtrl::Layout

BOOLLayout(HDLAYOUT*pHeaderLayout);

Return Value

Nonzero if successful; otherwise 0.

Parameters

pHeaderLayout

Pointer to an structure, which contains information used to set the size and position of a header control.

Remarks

Retrieves the size and position of a header control within a given rectangle. This function is used to determine the appropriate dimensions for a new header control that is to occupy the given rectangle.

Example

// The pointer to my header control.
extern CHeaderCtrl* pmyHeaderCtrl;
HDLAYOUT  hdl;
WINDOWPOS wpos;
RECT      rc;

// Reposition the header control so that it is placed at
// the top of its parent window's client area.
pmyHeaderCtrl->GetParent()->GetClientRect(&rc);

hdl.prc = &rc;
hdl.pwpos = &wpos;
pmyHeaderCtrl->Layout(&hdl);

pmyHeaderCtrl->SetWindowPos(
   CWnd::FromHandle(wpos.hwndInsertAfter),
   wpos.x,
   wpos.y,
   wpos.cx,
   wpos.cy,
   wpos.flags | SWP_SHOWWINDOW);

CHeaderCtrl OverviewClass MembersHierarchy Chart