Sign in to follow this  
Followers 0
Rad

Get icon from an EXE

4 posts in this topic

#1 ·  Posted (edited)

I thought it was simple, but I can't figure it out. Unfortunately the search results are either irrelevant or they are "How to make custom script icon".

The example uses a .dll, but simply trying an EXE doesn't seem to work. Is there something I'm missing?

GUICtrlCreateButton($files[$i][0], $x, $y, $form_icosz, $form_icosz, $BS_ICON)

GUICtrlSetImage(-1, "C:\Program Files\App\App.exe")

The same format above works when I specify an .ico file.

Edit: was using the wrong array index... It was actually $files[$i][2]

I should have waited to post :/

Also, I had to add a third parameter "1" to GUICtrlSetImage.

...Wish I could remove this post.

Edited by Rad

Share this post


Link to post
Share on other sites



Its the funtion "ExtractIconA" in shell32.dll. Try looking at DllCall functionin Autoit. Never dont this myself though...

Share this post


Link to post
Share on other sites

Look here.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

I thought it was simple, but I can't figure it out. Unfortunately the search results are either irrelevant or they are "How to make custom script icon".

The example uses a .dll, but simply trying an EXE doesn't seem to work. Is there something I'm missing?

GUICtrlCreateButton($files[$i][0], $x, $y, $form_icosz, $form_icosz, $BS_ICON)

GUICtrlSetImage(-1, "C:\Program Files\App\App.exe")

The same format above works when I specify an .ico file.

Edit: was using the wrong array index... It was actually $files[$i][2]

I should have waited to post :/

Also, I had to add a third parameter "1" to GUICtrlSetImage.

...Wish I could remove this post.

Since you figured it out please add "[sOLVED]" to your title (without quotes) so others know you no longer have a problem.

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  
Followers 0