#include <WinAPIEx.au3>
#include <WindowsConstants.au3>
If Not Run('notepad.exe') Then Exit 1
$hWnd = WinWait('[Class:Notepad]', '', 3)
If Not $hWnd Then Exit 2
Local $ahIcon[5]
For $i = 0 To 4
$ahIcon[$i] = _WinAPI_ShellExtractIcon('shell32.dll', $i + 100, 32, 32);mb 16
If $ahIcon[$i] Then _SendMessage($hWnd, $WM_SETICON, 0, $ahIcon[$i])
Sleep(1000)
Next
For $i = 0 To 4
If $ahIcon[$i] Then _WinAPI_DestroyIcon($ahIcon[$i])
Next