#Include <GUIConstantsEx.au3>
#Include <GUIImageList.au3>
#Include <GUIListView.au3>
#Include <WinAPIEx.au3>
#Include <WindowsConstants.au3>
Global Const $File = @SystemDir & '\shell32.dll'
Global Const $Width = 32
Global Const $Height = 32
$hForm = GUICreate('MyGUI', 800, 600, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX), $WS_EX_COMPOSITED)
$hListView = _GUICtrlListView_Create($hForm, 'Item', 0, 0, 800, 600, BitOR($LVS_AUTOARRANGE, $LVS_ICON))
_GUICtrlListView_SetTextBkColor($hListView, $CLR_NONE)
_GUICtrlListView_SetBkColor($hListView, 0xD9FFEB)
$hImageList = _GUIImageList_Create($Width, $Height, 5, 1)
_GUICtrlListView_SetImageList($hListView, $hImageList)
$Index = 0
While 1
$hIcon = _WinAPI_ShellExtractIcons($File, $Index, $Width, $Height)
If @error Then
ExitLoop
EndIf
_GUICtrlListView_InsertItem($hListView, $Index, $Index, $Index)
_GUIImageList_ReplaceIcon($hImageList, -1, $hIcon)
_WinAPI_FreeIcon($hIcon)
$Index += 1
WEnd
GUIRegisterMsg($WM_SIZE, 'WM_SIZE')
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam)
Local $Pos
Switch $hWnd
Case $hForm
$Pos = WinGetClientSize($hForm)
WinMove($hListView, '', 0, 0, $Pos[0], $Pos[1])
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_SIZE