Jump to content

_GUIImageList_AddIcon


 Share

Recommended Posts

  • Moderators

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