#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\..\Pictures\Icons\shell32_86.ico #AutoIt3Wrapper_Outfile_x64=..\..\Desktop\Icon-Viewer.Exe #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_Fileversion=0.98.7.0 #AutoIt3Wrapper_Res_ProductName=Icon-Viewer #AutoIt3Wrapper_Res_ProductVersion=0.98 #AutoIt3Wrapper_Res_LegalCopyright=autoBert #AutoIt3Wrapper_Res_Language=1031 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; *** Start added by AutoIt3Wrapper *** #include ; *** End added by AutoIt3Wrapper *** ; *** Start added by AutoIt3Wrapper *** ; *** End added by AutoIt3Wrapper *** ; *** Start added by AutoIt3Wrapper *** #include #include #include #include #include #include #include #include #include #include #include #include #include #cs compstui.dll|7 Licht aus|8 Licht ein|83 Telefon|95 Fax cryptui.dll| dot3ui.dll|1 Info filemgmt.dll|1 Hinweis msrating.dll.dll|10 OK(rund)11 abbrechen(rund) mmcndmgr.dll|9 abbrechen|14 Uhr|44 Lupe #ce Opt('MustDeclareVars', 1) Global $aSplit = StringSplit(@AutoItExe, '\') Global $sAutoItPath = StringReplace(@AutoItExe, $aSplit[$aSplit[0]], '') ConsoleWrite($sAutoItPath & @CRLF) Global $sIconPath = @UserProfileDir & "\Pictures\Icons" ;ConsoleWrite($sIconPath & @CRLF) If Not FileExists($sIconPath) Then DirCreate($sIconPath) ConsoleWrite(16 * 70 + 35 & @TAB & @DesktopWidth & @CRLF) If @DesktopWidth < 1200 Then Exit MsgBox($MB_ICONINFORMATION, 'Bildschirmbreite < 1200', 'Wählen sie eine andere Auflösung.' & @CRLF & 'Probieren sie es danach erneut') Global $hGui, $listview, $hListview, $hImage, $b, $iCount, $iWidth = @DesktopWidth, $iHeight = @DesktopHeight - 28 Global $Combo, $Progress, $Label, $aFile, $sDLLName, $Msg, $sTitel = "Icon-Übersicht ", $iSize = 32, $iOldSize = 32, $iOldIndex, $iOldSub, $iIndex, $iSub, $sRes $hGui = GUICreate($sTitel & $sDLLName, $iWidth, $iHeight, 0, 0) GUISetIcon("C:\Users\(len)Bert\Pictures\Icons\shell32_86.ico") $Combo = GUICtrlCreateCombo("", 2, 2, 240) $Progress = GUICtrlCreateProgress(245, 2, $iWidth - 257, 25) ;$Label = GUICtrlCreateLabel("TEST",330,2,200) $aFile = _FileListToArray(@SystemDir, "*.DLL") $listview = GUICtrlCreateListView("Save?", 1, 32, 1170, $iHeight - 28, $LVS_REPORT, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES, $LVS_EX_INFOTIP)) ;$listview = GUICtrlCreateListView("Save?", 1, 32, 1170, $iHeight - 28, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT), BitOR($LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES, $LVS_EX_CHECKBOXES)) $hListview = ControlGetHandle($hGui, "", $listview) Global $btnSave = GUICtrlCreateButton('ausgewähle Icons speichern', 1172, 32, $iWidth - 1174, 48, BitOR($ss_Notify, $BS_CENTER, $BS_VCENTER)) GUICtrlCreateGroup('&Icon speichern', 1172, 92, $iWidth - 1179, 188) Global $inpID = GUICtrlCreateEdit('IconId', 1175, 106, 50, 28, $ES_Number) GUICtrlSetLimit(-1, 3) ; to limit the entry to 3 chars Global $btnSSave = GUICtrlCreateButton('Icon speichern', 1230, 106, 110, 28, BitOR($ss_Notify, $BS_CENTER, $BS_VCENTER)) Global $IconPreview = GUICtrlCreateIcon(@SystemDir & '\shell32.dll', -140, 1175, 140, 32, 32, $ss_Notify) Global $cboSize = GUICtrlCreateCombo('16x16', 1235, 140, 90, 28, BitOR($CBS_DROPDOWN, $ss_Notify)) GUICtrlSetData(-1, '32x32|48x48|64x64', '32x32') GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group For $i = 1 To 16 ; Fügt die Spalten hinzu _GUICtrlListView_AddColumn($listview, "Spalte " & $i, 70) Next _GUICtrlListView_SetColumnWidth($listview, 0, 32) For $i = 1 To $aFile[0] If _WinAPI_ExtractIconEx($aFile[$i], -1, 0, 0, 0) > 0 Then _ GUICtrlSetData($Combo, $aFile[$i]) GUICtrlSetData($Progress, 100 - ($i / $aFile[0] * 100)) ;GUICtrlSetData($Label,$i & " / " & $aFile[0]) Next GUICtrlSetData($Combo, "shell32.dll", "shell32.dll") _showIcons("shell32.dll") GUISetState() ;MouseMove(@DesktopWidth - 40, 140) ;without many ToolTipinfo's GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Combo $sDLLName = GUICtrlRead($Combo) _showIcons($sDLLName) Case $btnSave $sDLLName = GUICtrlRead($Combo) _SaveRow($sDLLName) Case $btnSSave $sDLLName = GUICtrlRead($Combo) $iSize = GUICtrlRead($cboSize) _SaveToFile($sDLLName, GUICtrlRead($inpID), $iSize, $iSize) Case $cboSize $iSize = GUICtrlRead($cboSize) If $iSize <> $iOldSize Then $iOldSize = $iSize GUICtrlSendMsg($listview, $NM_RCLICK, 0x0000000000000005, 0x00000062819DEC00) EndIf EndSwitch WEnd Func _showIcons($sDLLName) Local $iCols, $iRows, $iIcons _GUICtrlListView_DeleteAllItems($hListview) $iCount = _LoadIcons($sDLLName) WinSetTitle($hGui, "", $sTitel & $sDLLName) ;;ConsoleWrite($sDLLName & " " & $iCount & @CRLF) _GUICtrlListView_SetImageList($listview, $hImage, 1) $iIcons = 0 For $iRows = 1 To Int(($iCount - 1) / 16) + 1 ;$iIcons += 1 ; Fügt die Items hinzu GUICtrlCreateListViewItem(' ', $listview) GUICtrlSetTip(-1, 'Zum späteren Speichern an-"Checken" (Mehrfachspeichern) um ganze Zeile zum Speichern zu übernehmen') ; _GUICtrlListView_AddItem($listview, " ", 0) For $iCols = 1 To 16 $iIcons += 1 ; fügt die SubItems hinzu _GUICtrlListView_AddSubItem($listview, $iRows - 1, " " & $iIcons - 1, $iCols, $iIcons) GUICtrlSetTip(-1, 'Rechtsklick um IconID für (Einzel-) Speichern zu übernehmen') ; _GUICtrlListView_SetToolTips ; If _GUICtrlListView_GetItemChecked($listview, $iRows) Then _ ; _SaveToFile($sDLLName, $iIcons) ;comment out and every icon in loop is saved in 32x32 ; _SaveToFile($sDLLName, $iIcons, 48, 48) ;comment out and every icon in loop is saved in 48x48 Next Next EndFunc ;==>_showIcons Func _LoadIcons($sDLLName) Local $iCount, $iIcons, $iError Static $iGesamt _GUIImageList_Destroy($hImage) ; Lädt die Bilder $hImage = _GUIImageList_Create(32, 32, 5, 3, 256, 512) _GUIImageList_AddIcon($hImage, @SystemDir & "\" & $sDLLName, 0, True) $iIcons = 0 Do $iError = _GUIImageList_AddIcon($hImage, @SystemDir & "\" & $sDLLName, $iIcons, True) ;If @error Then ConsoleWrite('Error: ' & @error & ' IconID: ' & $iIcons & @CRLF) $iIcons += 1 Until $iError <= 0 $iCount = _GUIImageList_GetImageCount($hImage) $iGesamt += $iCount If $iCount <> 0 Then ConsoleWrite($sDLLName & " " & $iCount & " " & $iGesamt & @CRLF) Return $iCount EndFunc ;==>_LoadIcons Func _SaveRow($sDLLName) Local $iCols, $iRows, $iIcons WinSetTitle($hGui, "", $sTitel & $sDLLName) For $iRows = 0 To _GUICtrlListView_GetItemCount($listview) - 1 If _GUICtrlListView_GetItemChecked($listview, $iRows) Then $iIcons = $iRows * 16 - 1 For $iCols = 1 To 16 $iIcons += 1 _SaveToFile($sDLLName, $iIcons, $iSize, $iSize) ; _SaveToFile($sDLLName, $iIcons, 48, 48) ;comment out and every icon in loop is saved in 48x48 Next EndIf Next EndFunc ;==>_SaveRow Func _SaveToFile($sDLLName, $iIconId, $iWidth = 32, $iHeight = 32) ConsoleWrite($sDLLName & @TAB & '|' & $iIconId & '|' & @TAB & $iWidth & '|' & $iHeight & @CRLF) Local $sFile = $sIconPath & '\' & StringReplace($sDLLName, '.dll', '_') & StringReplace($iIconId & '.ico', ' ', '') ConsoleWrite($sFile & @CRLF) Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\' & $sDLLName, $iIconId, $iWidth, $iHeight) _WinAPI_SaveHICONToFile($sFile, $hIcon) ;ShellExecute($sFile) _WinAPI_DestroyIcon($hIcon) EndFunc ;==>_SaveToFile Func clearToolTip() AdlibUnRegister("clearToolTip") ToolTip('') EndFunc ;==>clearToolTip Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $sIcon, $tInfo,$aHit, $aPos $sDLLName = GUICtrlRead($Combo) $hWndListView = $hListview If Not IsHWnd($hListview) Then $hWndListView = GUICtrlGetHandle($hListview) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button ;ListView_Action($iCode) ;#cs $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) Local $iIndex = DllStructGetData($tInfo, "Index") Local $iSub = DllStructGetData($tInfo, "SubItem") Local $sRes = _GUICtrlListView_GetItemText($hListview, $iIndex, $iSub) ConsoleWrite($iCode & @TAB & 'iIndex: ' & $iIndex & @TAB & 'iSub: ' & $iSub & @TAB & 'Text: ' & $sRes & @CRLF) If $iSub > 0 Then GUICtrlSetData($inpID, $sRes) $sIcon = @SystemDir & '\' & $sDLLName $sRes = -(1 + $sRes) ConsoleWrite($sIcon & @TAB & $sRes & @CRLF) GUICtrlSetImage($IconPreview, $sIcon, $sRes) EndIf ;#ce Case $LVN_HOTTRACK $aHit = _GUICtrlListView_SubItemHitTest($hListview) $iIndex = $aHit[0] $iSub = $aHit[1] ;_ArrayDisplay($aHit) If ($iIndex <> -1) And (($iIndex <> $iOldIndex) Or ($iSub <> $iOldSub)) Then ; _GUICtrlStatusBar_SetText($g_hStatusBar, @TAB & StringFormat("HitTest Item: %d, SubItem: %d", $aHit[0], $aHit[1])) $sRes = _GUICtrlListView_GetItemText($hListview, $iIndex, $iSub) ConsoleWrite('LV-SubInfo ItemIndex: ' & $iIndex & @TAB & 'SubIndex: ' & $iSub & @TAB & 'Text: ' & $sRes & @CRLF) $aPos = MouseGetPos() If $iSub = 0 Then AdlibRegister("clearToolTip", 3000) ToolTip('Zum späteren Speichern an-"Checken" (Mehrfachspeichern) um ganze Zeile zum Speichern zu übernehmen', $aPos[0]) Else AdlibRegister("clearToolTip", 3000) ToolTip('Rechtsklick um IconID für (Einzel-) Speichern zu übernehmen', $aPos[0] + 10, $aPos[1] + 10) EndIf $iOldIndex = $aHit[0] $iOldSub = $aHit[1] EndIf Case $NM_KILLFOCUS ; The control has lost the input focus ToolTip('') EndSwitch Case Else ToolTip('') EndSwitch ; Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY