#include <GUIConstantsEx.au3>
#include <SendMessage.au3>
#include <StaticConstants.au3>
#include <WinAPIIcons.au3>
#include <WinAPIShellEx.au3>
Local $iIndex = 0, $iTotal = _WinAPI_ExtractIconEx(@SystemDir & '\shell32.dll', -1, 0, 0, 0)
ConsoleWrite($iTotal & @CR)
_ArrayDisplay($iTotal)
Local $hForm = GUICreate('Test ' & StringReplace(@ScriptName, '.au3', '()'), 160, 160)
Local $idButtonP = GUICtrlCreateButton('назад', 5, 130, 70, 23)
Local $idButtonN = GUICtrlCreateButton('вперед', 80, 130, 70, 23)
Local $idIcon = GUICtrlCreateIcon(@SystemDir & '\shell32.dll', 0, 69, 54, 32, 32)
Local $hIcon = GUICtrlGetHandle(-1)
Local $Lable = GUICtrlCreateLabel("", 10, 10, 50, 20)
GUISetState(@SW_SHOW)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idButtonP
$iIndex -= 1
If $iIndex < 0 Then
$iIndex = $iTotal - $iIndex - 1
EndIf
_WinAPI_DestroyIcon(_SendMessage($hIcon, $STM_SETIMAGE, 1, _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', $iIndex, 32, 32)))
GUICtrlSetData($Lable, $iIndex)
Case $idButtonN
$iIndex += 1
If $iIndex > $iTotal - 1 Then
$iIndex = 0
EndIf
_WinAPI_DestroyIcon(_SendMessage($hIcon, $STM_SETIMAGE, 1, _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', $iIndex, 32, 32)))
GUICtrlSetData($Lable, $iIndex)
EndSwitch
WEnd