Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How can I extract icon from file resources?

$
0
0
I've made script but it doesn't work. Please help

************************************************************

#include <WinAPI.au3>
#include <WinAPIEx.au3>
#Include <APIConstants.au3>

$hInstance = _WinAPI_LoadLibraryEx(@SystemDir & '\shell32.dll', $LOAD_LIBRARY_AS_DATAFILE)

$hResource = _WinAPI_FindResource($hInstance, 3, '#1') ;$RT_ICON
$iSize = _WinAPI_SizeOfResource($hInstance, $hResource)
$hData = _WinAPI_LoadResource($hInstance, $hResource)
$pData = _WinAPI_LockResource($hData)
$hFile = FileOpen(@ScriptDir & '\shell32.ico', 2 + 16)
$tData = DllStructCreate('byte[' & $iSize & ']', $pData)
FileWrite($hFile, DllStructGetData($tData, 1))
FileClose($hFile)

_WinAPI_FreeLibrary($hInstance)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>