Jump to content
Sign in to follow this  


Recommended Posts


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.")

$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


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.