Probiere es mal so:
AutoIt
#pragma compile(Icon, "c:\Program Files (x86)\AutoIt3\Icons\MyAutoIt3_Green.ico")
#AutoIt3Wrapper_UseX64=y
#include <GuiConstantsEx.au3>
#include <WinAPIShellEx.au3>
#include <WinAPIGdi.au3>
Global Const $STM_SETIMAGE = 0x0172
Global Const $hIcon = _WinAPI_ShellExtractIcon(@AutoItExe, 0, 48, 48)
Global Const $hBmp = _WinAPI_Create32BitHBITMAP($hIcon, False, True)
Global Const $hGUI = GUICreate("Test", 300, 400)
Global Const $iPic = GUICtrlCreatePic("", 100, 100, 48, 48)
_WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBmp))
GUISetState()
Do
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_WinAPI_DeleteObject($hBmp)
GUIDelete()
Exit
EndSwitch
Until False
Alles anzeigen