本帖最后由 weiyun 于 2010-8-7 21:46 编辑
1.修改LoadStateImage函数
2.添加如下指令(注意:="C:\Program Files\Resource Hacker\ResHacker.exe" win7.bmp upx.exe 需要改为你自己的路径)#AutoIt3Wrapper_UseUpx=N
#AutoIt3Wrapper_Run_After="C:\Program Files\Resource Hacker\ResHacker.exe" -add %out%, %out%,win7.bmp, bitmap, StateImage, 0
#AutoIt3Wrapper_Run_After=upx.exe --best --compress-resources=0 "%out%"
Func LoadStateImage($hTreeView, $sFile)
Local $hWnd = GUICtrlGetHandle($hTreeView)
If $hWnd = 0 Then $hWnd = $hTreeView
Local $hImageList = 0
If @Compiled Then
Local $hModule = LoadLibrary(@ScriptFullPath)
$hImageList = ImageList_LoadImage($hModule, "#170", 16, 1, $CLR_NONE, $IMAGE_BITMAP, BitOr($LR_LOADTRANSPARENT, $LR_CREATEDIBSECTION))
Else
$hImageList = ImageList_LoadImage(0, $sFile, 16, 1, $CLR_NONE, $IMAGE_BITMAP, BitOr($LR_LOADFROMFILE, $LR_LOADTRANSPARENT, $LR_CREATEDIBSECTION))
EndIf
SendMessage($hWnd, $TVM_SETIMAGELIST, $TVSIL_STATE, $hImageList)
InvalidateRect($hWnd, 0, 1)
EndFunc
|