HDM_GETORDERARRAY (Windows CE 5.0)

Send Feedback

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

HDM_GETORDERARRAYwParam = (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;
    int *lpiArray = NULL;
    
    // Get the number of header items
    iItems = SendMessage(hwndHD, HDM_GETITEMCOUNT, 0,0);
    if (iItems > 0)
    {
      // Get memory for buffer
      lpiArray = LocalAlloc(LMEM_FIXED, iItems*sizeof(int));
      if (lpiArray)
      {
        SendMessage(hwndHD, HDM_GETORDERARRAY, iItems, lpiArray);
        // If succesful use the index values retrieved here
      }
      else
      {
        MessageBox(hwnd, L"Out of memory.","Error", MB_OK);
      }
    }
    if (lpiArray)
    {
      LocalFree(lpiArray);
    }
    

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.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Commctrl.h.

See Also

Header Controls Messages | Header_GetOrderArray | HDM_GETITEMCOUNT

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.