Header_InsertItem macro (commctrl.h)

Inserts a new item into a header control. You can use this macro or send the HDM_INSERTITEM message explicitly.

Syntax

int Header_InsertItem(
         HWND     hwndHD,
         int      i,
   const LPHDITEM phdi
);

Parameters

hwndHD

Type: HWND

A handle to the header control.

i

Type: int

The index of the item after which the new item is to be inserted. The new item is inserted at the end of the header control if i is greater than or equal to the number of items in the control. If i is zero, the new item is inserted at the beginning of the header control.

phdi

Type: const LPHDITEM

A pointer to an HDITEM structure that contains information about the new item.

Return value

Type: int

Returns the index of the new item if successful, or -1 otherwise.

Remarks

The Header_InsertItem macro is defined as follows:

#define Header_InsertItem(hwndHD, i, phdi) \

    (int)SendMessage((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), \

    (LPARAM)(const LPHDITEM)(phdi))

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