Header_GetOrderArray macro

Gets the current left-to-right order of items in a header control. You can use this macro or send the HDM_GETORDERARRAY message explicitly.

Syntax


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

Parameters

hwndHD

Type: HWND

A handle to a header control.

iSize

Type: int

The number of integer elements that lpiArray can hold. This value must be equal to the number of items in the control (see HDM_GETITEMCOUNT).

lpiArray

Type: int*

A pointer to an array of integers that receive the index values for items in the header.

Return value

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. Returns zero otherwise.

Remarks

The number of elements in lpiArray is specified in iSize and must be equal to the number of items in the control. For example, the following code fragment will reserve enough memory to hold the index values.



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);

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Commctrl.h

 

 

Show: