请英文好的朋友帮我看看 autoit官方论坛 关于Treeview 三态选择框的问题。
这是官方论坛的链接http://www.autoitscript.com/forum/index.php?showtopic=28464&hl=TristateTreeViewLib
他里面有一段这样的说明
; You could also use a integrated bmw (with ResourceHacker)
; Please see TristateTreeViewLib.au3 in line 257 (LoadStateImage)
; !!! You must not compiled it full with UPX, just use after compiling: upx.exe --best --compress-resources=0 xyz.exe !!!
; If you choose another reource number then 170 you have to change the LoadStateImage() function
;
; Userfunction My-WM_Notify() is registered in TristateTreeViewLib.au3 !
;
; You can get other check bitmaps also together with freeware install programs like i.e. NSIS
; it must have 5 image states in it:
; 1.empty, 2.unchecked, 3.checked, 4.disabled and unchecked, 5.disabled and checked
;Global $sStateIconFile = @ScriptDir & "\simple.bmp"
现在的问题是 他提供的 脚本 编译后三态无效。。
好像里面有解决方法
但由于英文太差 实在不理解。
[ 本帖最后由 lele9013 于 2008-11-5 14:55 编辑 ] ....= = 麻烦大家看看~ 继续。。。。。。。。。。 自己搞定了。。 说说看,让我们也学习一下 本帖最后由 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
页:
[1]