Moderators big_daddy Posted December 30, 2007 Moderators Share Posted December 30, 2007 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 More sharing options...
GaryFrost Posted December 30, 2007 Share Posted December 30, 2007 _WinAPI_ExtractIconEx SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted December 30, 2007 Author Moderators Share Posted December 30, 2007 _WinAPI_ExtractIconExThanks Gary, that done the trick. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now