Jump to content
Sign in to follow this  

Issue with GUICtrlSetImage from an exe file

Recommended Posts


With AutoIt, GUICtrlSetImage (-1, "progman.exe",33) doesn't work. It was working with previous version.

I've tested with different icons of progman.exe ; it still works from GUICtrlSetImage (-1, "progman.exe",0) to GUICtrlSetImage (-1, "progman.exe",11). I've also tested with taskmgr.exe ; the issue is still there.

#include <


GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUICtrlCreateButton ("my picture button", 10,20,40,40, $BS_ICON)

;GUICtrlSetImage (-1, "shell32.dll",22)

GUICtrlSetImage (-1, "progman.exe",33)

GUISetState ()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Thanks for your help.

Share this post

Link to post
Share on other sites

Look here

 and here

it was changed:

Passing a positive number will reference the string equivalent icon name.

Passing a negative number causes 1-based "index" behaviour. Some Dll can have icon extracted just with negative numbers.



GUICtrlSetImage (-1, "progman.exe",33)


GUICtrlSetImage (-1, "progman.exe",-34)
Edited by Zedna

Share this post

Link to post
Share on other sites

Thanks it works fine !

I had read help but I hadn't understood what 1-based "index" means.

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.