Jump to content
Sign in to follow this  

Save first icon of exe as PNG & JPG

Recommended Posts


thanks goes to progandy

; icon to JPEG & PNG converter - use first icon in EXE only 
; based upon progandy's scripts
#include <GDIPlus.au3>

$filename = "c:\Programme\8start Launcher\8start.exe"
$iconnumber = 0 ;

$Ret = DllCall("shell32","long","ExtractAssociatedIcon","int",0,"str",$filename,"int*",$iconnumber)
$hIcon = $Ret[0]
        $pBitmap = DllCall($ghGDIPDll,"int","GdipCreateBitmapFromHICON", "ptr",$hIcon, "int*",0)
        $pBitmap = $pBitmap[2]
_GDIPlus_ImageSaveToFile($pBitmap, @ScriptDir & "\Test.jpg")
_GDIPlus_ImageSaveToFile($pBitmap, @ScriptDir & "\Test.png")

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