Header_GetOrderArray macro (commctrl.h)
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 hwnd,
int iCount,
int *lpi
);
Parameters
hwnd
Type: HWND
A handle to a header control.
iCount
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).
lpi
Type: int*
A pointer to an array of integers that receive the index values for items in the header.
Return value
Type: BOOL
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 iCount 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,
*lpi;
// Get memory for buffer
if((iItems = SendMessage(hwnd, HDM_GETITEMCOUNT, 0,0))!=-1)
if(!(lpiArray = calloc(iItems,sizeof(int))))
MessageBox(hwnd, "Out of memory.","Error", MB_OK);
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | commctrl.h |