BOOL GetOrderArray( LPINT piArray, int iCount = -1 );
Return Value
Nonzero if successful; otherwise 0.
Parameters
piArray
A pointer to the address of a buffer that receives the index values of the items in the header control, in the order in which they appear from left to right.
iCount
The number of header control items.
Remarks
This member function implements the behavior of the Win32 message HDM_GETORDERARRAY, as described in the Platform SDK. It is provided to support header item ordering.
If you use iCount’s default value, GetOrderArray fills the parameter using GetItemCount.
Example
// The pointer to my header control.
extern CHeaderCtrl* pmyHeaderCtrl;
// Reverse the order of the items in the header control.
// (i.e. make the first item the last one, the last item
// the first one, and so on ...).
int nCount = pmyHeaderCtrl->GetItemCount();
LPINT pnOrder = (LPINT) malloc(nCount*sizeof(int));
ASSERT(pnOrder != NULL);
pmyHeaderCtrl->GetOrderArray(pnOrder, nCount);
int i, j, nTemp;
for (i=0,j=nCount-1;i < j;i++,j--)
{
nTemp = pnOrder[i];
pnOrder[i] = pnOrder[j];
pnOrder[j] = nTemp;
}
pmyHeaderCtrl->SetOrderArray(nCount, pnOrder);
free(pnOrder);
CHeaderCtrl Overview | Class Members | Hierarchy Chart
See Also CHeaderCtrl::SetOrderArray, CHeaderCtrl::OrderToIndex