Sign in to follow this  
Followers 0
big_daddy

_GUIImageList_AddIcon

3 posts in this topic

I was in the process of updating Uninstall Apps when I came across some strange behavior. If the file passed to _GUIImageList_AddIcon does not contain an icon, I get an error message "_GUIImageList_AddIcon: -1", then the script exits. If this is the expected behavior, how can I test the file for an icon before calling _GUIImageList_AddIcon?

#include <GUIImageList.au3>

$sDLL = @WindowsDir & "\system32\kernel32.dll"
If Not FileExists($sDLL) Then
    MsgBox(64, "Error", "The specified file does not exist.")
    Exit
EndIf

$hImages = _GUIImageList_Create(16, 16)
$iReturn = _GUIImageList_AddIcon($hImages, $sDLL, 0)
MsgBox(0, "", "We never get here.")

Share this post


Link to post
Share on other sites



_WinAPI_ExtractIconEx

Thanks Gary, that done the trick.

Share this post


Link to post
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
Sign in to follow this  
Followers 0