Jump to content

_GUIImageList_AddIcon load rom Array [SOLVED]


Recommended Posts

 

Local $hGui, $listview, $hImage

    Local $aArray = _FileListToArrayRec(IniRead($ini, "Name", "path", ""), "*file.exe", $FLTAR_FILES, 1, $FLTAR_SORT,$FLTAR_FULLPATH)

    $hGui = GUICreate("ImageList", 400, 300)
    $listview = _GUICtrlListView_Create($hGui, "", 2, 2, 394, 268)
    _GUICtrlListView_InsertColumn($listview, 0, "Programs", 300)
    $hImage = _GUIImageList_Create(32, 32)
    GUISetState()

    $fileArray = UBound($aArray) -1

        For $y = 1 To $fileArray
                _GUIImageList_AddIcon($hImage, $IniRead($ini,$aArray[$y], "icon", ""))
                _GUICtrlListView_SetImageList($listview, $hImage, 1)
                _GUICtrlListView_AddItem($listview, $aArray[$y])
        Next

 

 
I would like to place an icon dynamically from an .ini file. 
From the .ini file the name of the program is loaded properly , but the icon remains the same, It loads only the icon of the first program.

could Someone help me?

Thanks

Mea culpa,

$ico =_GUIImageList_AddIcon($hImage, $IniRead($ini,$aArray[$y], "icon", ""))

_GUICtrlListView_SetImageList($listview, $hImage, 1)

_GUICtrlListView_AddItem($listview, $aArray[$y],$ico)

Edited by rootx
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...