Header_GetOrderArray

This macro 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 message: HDM_GETORDERARRAY

Syntax

BOOL Header_GetOrderArray(HWND hwndHD, int iSize, int *lpiArray);

Parameters

hwndHD

Handle to a header control.

iSize

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

lpiArray

Long pointer to a buffer that receives the index values of the items in the header. The buffer should be big enough to hold the total number of items * sizeof(int). For example, the following code fragment will reserve enough memory to hold the index values.

Return Values

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

Example

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