# Function Reference

# _GUICtrlListView_GetView

Retrieves the current view of the control

#include <GuiListView.au3>
_GUICtrlListView_GetView ( $hWnd )

## Parameters

$hWnd | Control ID/Handle to the control

## Return Value

Success: | The current view: 0 - Large Icon 1 - Details 2 - List 3 - Small Icon 4 - Tile
Failure: | -1.

## Related

_GUICtrlListView_GetViewDetails, _GUICtrlListView_GetViewLarge, _GUICtrlListView_GetViewList, _GUICtrlListView_GetViewSmall, _GUICtrlListView_GetViewTile, _GUICtrlListView_SetView

## Example

    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>
    #include <MsgBoxConstants.au3>

    Example()

    Func Example()
        GUICreate("ListView Get View (v" & @AutoItVersion & ")", 400, 300)
        Local $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
        GUISetState(@SW_SHOW)

        ; Set ANSI format
    ;~     _GUICtrlListView_SetUnicodeFormat($idListview, False)

        ; Add columns
        _GUICtrlListView_AddColumn($idListview, "Items", 100)

        ; Add items
        _GUICtrlListView_BeginUpdate($idListview)
        For $iI = 1 To 10
            _GUICtrlListView_AddItem($idListview, "Item " & $iI)
        Next
        _GUICtrlListView_EndUpdate($idListview)

        ; Set view
        MsgBox($MB_SYSTEMMODAL, "Information", "View: " & _GUICtrlListView_GetView($idListview))
        _GUICtrlListView_SetView($idListview, 4)
        MsgBox($MB_SYSTEMMODAL, "Information", "View: " & _GUICtrlListView_GetView($idListview))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
    EndFunc   ;==>Example