HDM_GETORDERARRAY

This message retrieves the current left-to-right order of items in a header control.

At a Glance

Header file: Commctrl.h
Windows CE versions: 2.0 and later
Related macro: Header_GetOrderArray

Syntax

HDM_GETORDERARRAY wParam = (WPARAM) (int) iSize;
lParam = (LPARAM) lpiArray;

Parameters

iSize

Size of the buffer at lpiArray, in elements. This value must equal the value returned by HDM_GETITEMCOUNT.

lpiArray

Long pointer to the buffer that receives the index values for items in the header. The buffer must be large enough to hold the total number of header items * sizeof(int). The following code example shows how to reserve enough memory to hold the index values.

INT iItems,
    *lpiArray ;

// Get memory for buffer
(iItems = SendMessage(hwndHD, HDM_GETITEMCOUNT, 0,0))!=-1)
    if(!(lpiArray = calloc(iItems,sizeof(INT))))
MessageBox(hwnd, "Out of memory.","Error", MB_OK);

Return Values

Returns nonzero if successful, and the buffer at lpiArray receives the item number for each item in the header control, in the order in which they appear from left to right. Otherwise, the message returns zero.