Jump to content

Save first icon of exe as PNG & JPG


nobbe
 Share

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]
_GDIPlus_Startup()
        $pBitmap = DllCall($ghGDIPDll,"int","GdipCreateBitmapFromHICON", "ptr",$hIcon, "int*",0)
        $pBitmap = $pBitmap[2]
_GDIPlus_ImageSaveToFile($pBitmap, @ScriptDir & "\Test.jpg")
_GDIPlus_ImageSaveToFile($pBitmap, @ScriptDir & "\Test.png")
_GDIPlus_ImageDispose($pBitmap)
_GDIPlus_Shutdown()
_WinAPI_DestroyIcon($Ret[0])
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...