#Include <WinAPIEx.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
Local $InstallDir=RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt','InstallDir')
If @error Then
MsgBox(16,'MLGBD','你用的不是ACN版吧?或者没安装?')
Exit
EndIf
Local $toolbar=$InstallDir&'\SciTe\toolbar.dll'
Local $ResHacker=$InstallDir&'\Extras\OtherEXE\ResHacker.exe'
If Not FileExists($toolbar) Then
MsgBox(16,'MLGBD','没看到 '&$toolbar&' 啊!不干!')
Exit
EndIf
If Not FileExists($ResHacker) Then
MsgBox(16,'MLGBD','没看到 '&$ResHacker&' 啊!不干!')
Exit
EndIf
Local $Form1 = GUICreate("SciTE 工具栏图标库 查图标ID", 326, 123, 385, 191)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
Local $Radio1 = GUICtrlCreateRadio("清加ICO图标到toolbar.dll再选择", 24, 16)
Local $Radio2 = GUICtrlCreateRadio("直接从toolbar.dll中选择图标", 24, 48)
GUICtrlSetState(-1,$GUI_CHECKED)
Local $Button1 = GUICtrlCreateButton("好了", 172, 80, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Form1Close()
Exit
EndFunc
Func Button1Click()
Local $Icons=_WinAPI_ExtractIconEx($toolbar, -1, 0, 0, 0)
If GUICtrlRead($Radio1)=$GUI_CHECKED Then
;ResHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, NewImage.bmp , bitmap,128,
Local $icoFile=FileOpenDialog('选择一个图标文件','','图标(*.ico)|可执行文件(*.exe)',3,'',$Form1)
If @error Then Return
If StringRight($icoFile,4)='.exe' Then
FileDelete(@TempDir&'\Icon_*.*')
RunWait('"'&$ResHacker&'" -extract "' & $icoFile & '" , "' & @TempDir & '\Icon_.rc", icongroup,,')
If FileExists(@TempDir&'\Icon_1.ico') Then $icoFile=@TempDir&'\Icon_1.ico'
EndIf
RunWait('"'&$ResHacker&'" -addoverwrite '&$toolbar&', '&$toolbar&', '&$icoFile&' , ICONGROUP,I'&$Icons&',')
;删除产生的文件
FileDelete($InstallDir&'\Extras\OtherEXE\ResHacker.ini')
FileDelete($InstallDir&'\Extras\OtherEXE\ResHacker.log')
FileDelete(@TempDir&'\Icon_*.*')
$Icons+=1
EndIf
Local $Data = _WinAPI_PickIconDlg($toolbar, $Icons-1,$Form1)
If @error Then Return
If $Data[0]=$toolbar Then
MsgBox(64,'去改吧!','你想用的图标ID为: '&$Data[1])
Else
MsgBox(16,'MLGB','没人说可以换图标资源文件的!')
EndIf
EndFunc
蛋疼写个了脚本用来方便添加图标到[ toolbar.dll ]SciTE 工具栏图标库中的.