Jump to content

[SOLVED] Adding embedded Icon resource to ImageList


schuc
 Share

Recommended Posts

I have been working on getting my script compile friendly so the .exe can be brought to other PCs and work fine. I was able to load the resources into the .exe ok, but I am having trouble recalling and adding the icons to my imagelist to be used in a listview control.

I have been reviewing Zedna's Resources UDF and many forum posts, but haven't found or been able to create the correct syntax for this yet.

Below is the area of code that is not working correctly. The ELSE part is fine when run non-compiled. I could really use some on getting those icons added to the list if compiled though. I think I'm close, but no cigar just yet..lol.

Edit: I should mention that I don't receive any errors and it compiles just fine... I just don't get any icons in my listview rows as I do when running it non-compiled.

Thanks for any help or suggestions!

; Load images
            $hImage = _GUIImageList_Create(16, 16, 5, 1)
            if @Compiled Then
                _GUIImageList_AddIcon($hImage, @ScriptFullPath, 3)
                _GUIImageList_AddIcon($hImage, @ScriptFullPath, 4)
                _GUIImageList_AddIcon($hImage, @ScriptFullPath, 5)
;~              _GUIImageList_AddIcon($hImage, _ResourceGet("4", $RT_CURSOR))
;~              _GUIImageList_AddIcon($hImage, _ResourceGet("5", $RT_CURSOR))
;~              _GUIImageList_AddIcon($hImage, _ResourceGet("6", $RT_CURSOR))
            Else
                _GUIImageList_AddIcon($hImage, "STATUS_Question.ico")
                _GUIImageList_AddIcon($hImage, "STATUS_Success.ico")
                _GUIImageList_AddIcon($hImage, "STATUS_Fail.ico")
                _GUICtrlListView_SetImageList($ListAV, $hImage, 1)
            EndIf
Edited by schuc
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...