Jump to content
Sign in to follow this  
jpd

Issue with GUICtrlSetImage from an exe file

Recommended Posts

jpd

With AutoIt 3.2.6.0, 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 <

GUIConstants.au3>

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

Wend
Thanks for your help.

Share this post


Link to post
Share on other sites
Zedna

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.

EDIT:

instead

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

try

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

Share this post


Link to post
Share on other sites
jpd

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  

×