# Function Reference

# _GUICtrlHeader_GetItemText

Retrieves the item text

#include <GuiHeader.au3>
_GUICtrlHeader_GetItemText ( $hWnd, $iIndex )

## Parameters

$hWnd | Handle to the control
$iIndex | 0-based item index

## Return Value

Returns the item text.

## Related

_GUICtrlHeader_SetItemText

## Example

### Example 1

    #include "Extras\HelpFileInternals.au3"

    #include <GUIConstantsEx.au3>
    #include <GuiHeader.au3>

    Example()

    Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("Header Get/Set Item Text (v" & @AutoItVersion & ")", 450, 300, 100, 100)
        Local $hHeader = _GUICtrlHeader_Create($hGUI)
        _MemoCreate(2, 52, 444, 220)

    ;~  _GUICtrlHeader_SetUnicodeFormat($hHeader, True)

        GUISetState(@SW_SHOW)

        ; Add columns
        _GUICtrlHeader_AddItem($hHeader, "Column 0", 100)
        _GUICtrlHeader_AddItem($hHeader, "Column 1", 100)
        _GUICtrlHeader_AddItem($hHeader, "Column 2", 100)
        _GUICtrlHeader_AddItem($hHeader, "Column 3", 100)

        ; Set column 0 text
        _GUICtrlHeader_SetItemText($hHeader, 0, "Column X")

        ; Show column 0 text
        _MemoWrite("Column 0 text: " & _GUICtrlHeader_GetItemText($hHeader, 0))

        _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

    EndFunc   ;==>Example

### Example 2 : Header Get/Set Item Text to an External process

    #include "Extras\HelpFileInternals.au3"

    #include <GuiHeader.au3>

    Example()

    Func Example()
        Local $sFromTo
        Local $hWin = _MemoRunAU3OutProcess($sFromTo) ; OK if run in different Mode

        Local $hHeader = _MemoCreateOutProcess($hWin, "SysHeader32", 0, $sFromTo)

        ; Set column 1 text
        _GUICtrlHeader_SetItemText($hHeader, 1, "<<<Column Y")
        _MemoWrite("<<< Column 1 text: " & _GUICtrlHeader_GetItemText($hHeader, 1))

        _MemoMsgBoxStatus("", -1, $hWin) ; no more action, wait GUI for closing

    EndFunc   ;==>Example