Icon aus EXE mit bestimmter Größe in GUI einbetten

    • Offizieller Beitrag


    Auch wenn ich den Index jetzt schon habe (der Gesuchte war 99), würde es mich interessieren, ob man die Indices auch eleganter auflisten könnte.

    Vielleicht so:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Const $sPathExe = @SystemDir & '\mspaint.exe'
    Global $aidICO[1], $aidLABEL[1], $iCount = 0

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate('Test', 640, 200)
    For $i = 0 To 255
    $aidICO[$iCount] = GUICtrlCreateIcon($sPathExe, 2, 10 + $iCount * 64, 10, 48, 48)
    $aidLABEL[$iCount] = GUICtrlCreateLabel($i, 10 + $iCount * 64, 65, 48, 20, $SS_CENTER)
    $iRet = GUICtrlSetImage($aidICO[$iCount], $sPathExe, $i)
    If $iRet Then
    $iCount += 1
    ReDim $aidICO[$iCount + 1]
    ReDim $aidLABEL[$iCount + 1]
    EndIf
    Next
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    [/autoit]