faustf Posted November 9, 2014 Share Posted November 9, 2014 how is possible extract icon from exe??? i try some _WinAPI_ExtractIconEx but i dont understund how use , someone can help please #include <MsgBoxConstants.au3> #include <WinAPIShellEx.au3> #include <WinAPI.au3> ;Local $sVar = RegRead("HKEY_CLASSES_ROOT", ".avi") ;Local $sVar = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") ;MsgBox($MB_SYSTEMMODAL, "Program files are in:", $sVar) Global $svar,$svar2 $sVar = RegRead('HKEY_CLASSES_ROOT\.avi','') $svar2 = RegRead ('HKEY_CLASSES_ROOT\'&$sVar&'\shell\open\command','') ;MsgBox($MB_SYSTEMMODAL, "Program files are in:", $sVar2) ;Local $test=_WinAPI_ShellExtractIcon($sVar2, '', 32, 32) local $iResult = _WinAPI_ExtractIconEx($sVar2, 0, 0, 16, 1) ;Local $test=_WinAPI_ShellGetFileInfo ( $sVar2, $SHGFI_ICON);, 0, 0 ) MsgBox (0,'',$iResult) ;Run($sVar2) Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2014 Share Posted November 9, 2014 Will You use the icon for? Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
mikell Posted November 9, 2014 Share Posted November 9, 2014 ? #include <GDIPlus.au3> #include <WinAPIShellEx.au3> ExtractIcon(@systemdir & "\notepad.exe", @ScriptDir & "\notepad.png") Func ExtractIcon($file, $output) $hIcon = _WinAPI_ShellExtractIcon($file, 0, 32, 32) _GDIPlus_Startup() $pBitmap = _GDIPlus_BitmapCreateFromHICON($hIcon) _GDIPlus_ImageSaveToFileEx($pBitmap, $output, _GDIPlus_EncodersGetCLSID("PNG")) _GDIPlus_ImageDispose($pBitmap) _GDIPlus_Shutdown() _WinAPI_DestroyIcon($hIcon) EndFunc Link to comment Share on other sites More sharing options...
faustf Posted November 9, 2014 Author Share Posted November 9, 2014 i have a list in txt of file example: ciccio.avi , pippo.pdf ..... i want find by extention a icon and use them in listview Link to comment Share on other sites More sharing options...
TheSaint Posted November 9, 2014 Share Posted November 9, 2014 (edited) @faustf - Your variable $svar2 may be returning unwanted data along with the path to the exe. It certainly would do that on my system, where I have something like - "C:Program FilesApplian TechnologiesApplian FLV and Media Playeramp.exe" -I skins2 --started-from-file "%1" You only want the path inside the first lot of quotes, and everything else should be stripped. It won't work otherwise. In mikell's good example, you would be using the stripped result for the variable $file. Edited November 9, 2014 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2014 Share Posted November 9, 2014 Look: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> #include <GuiImageList.au3> $hGUI = GUICreate("ListView example", 300, 200) $hListView = _GUICtrlListView_Create($hGUI, "Items|SubItems", 10, 10, 280, 150, $LVS_REPORT, $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, _ $LVS_EX_SUBITEMIMAGES, $LVS_EX_INFOTIP)) Local $sVar = RegRead('HKEY_CLASSES_ROOT\.avi','') Local $svar2 = RegRead ('HKEY_CLASSES_ROOT\'&$sVar&'\DefaultIcon','') Local $asIcon=StringSplit($svar2,",") $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon($hImage,StringReplace($asIcon[1],'"',''), Int($asIcon[2])) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131) _GUICtrlListView_SetImageList($hListView, $hImage, 1) _GUICtrlListView_AddItem($hListView, "Test item") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Saludos faustf 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
faustf Posted November 9, 2014 Author Share Posted November 9, 2014 you ar egenius Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now