_GUICtrlTreeView和_GUICtrlListBox问题(已解决)
本帖最后由 jinhao 于 2010-2-20 13:36 编辑如何循环判断选中状态并添加到GUICtrlCreateList,已添加过的当没有选中时在GUICtrlCreateList中删除。#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#Include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
#include<ShellTristateTreeView_v27.au3>
Global $sStateIconFile = "checkbox_modern.bmp"
Global $hItem, $hImage, $iImage, $hTreeView,$nMsg,$dll
Global $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 464, 277, 237, 123)
$hTreeView = GUICtrlCreateTreeView(2, 2, 161, 227, $iStyle, $WS_EX_CLIENTEDGE)
$List1 = GUICtrlCreateList("", 168, 1, 289, 232)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_GUICtrlTreeView_BeginUpdate($hTreeView)
$hItem0 = _GUICtrlTreeView_Add($hTreeView, 0, "软件分类1", 1, 1)
$Child0=_GUICtrlTreeView_AddChild($hTreeView,$hItem0,"winrar_01", 1, 1)
$Child1=_GUICtrlTreeView_AddChild($hTreeView,$hItem0,"Flash Player_01", 1, 1)
$Child2=_GUICtrlTreeView_AddChild($hTreeView,$hItem0,"ACDSee_01", 1, 1)
$Child3=_GUICtrlTreeView_AddChild($hTreeView,$hItem0,"QQ_01", 1, 1)
$hItem1 = _GUICtrlTreeView_Add($hTreeView, 0, "软件分类2", 1, 1)
$Child01=_GUICtrlTreeView_AddChild($hTreeView,$hItem1,"winrar_02", 1, 1)
$Child02=_GUICtrlTreeView_AddChild($hTreeView,$hItem1,"Flash Player_02", 1, 1)
$Child03=_GUICtrlTreeView_AddChild($hTreeView,$hItem1,"ACDSee_02", 1, 1)
$Child04=_GUICtrlTreeView_AddChild($hTreeView,$hItem1,"QQ_02", 1, 1)
_GUICtrlTreeView_EndUpdate($hTreeView)
LoadStateImage($hTreeView, $sStateIconFile)
GUIRegisterMsg($WM_NOTIFY, "MY_WM_NOTIFY_ShellTristateTreeView")
_GUICtrlTreeView_SetChecked($hTreeView,$hItem0)
_GUICtrlTreeView_SetChecked($hTreeView,$Child0)
_GUICtrlListBox_InsertString($List1,'准备安装:'&"winrar_01",0)
_GUICtrlTreeView_SetChecked($hTreeView,$hItem1)
_GUICtrlTreeView_SetChecked($hTreeView,$Child02)
_GUICtrlListBox_InsertString($List1,'准备安装:'&"Flash Player_02",1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func MY_WM_NOTIFY_ShellTristateTreeView($hWnd, $Msg, $wParam, $lParam)
;ShellTreeView.au3
; ==========
Local $tNMHDR, $hWndFrom, $iCode
$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
$hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndTreeView
;ConsoleWrite($iCode & @CRLF)
Switch $iCode
Case - 454 ; $TVN_ITEMEXPANDING (-405) > Changed due to TreeView UNICODE to -454!!!!?
;Case $TVN_ITEMEXPANDING
;ConsoleWrite($TVN_ITEMEXPANDING & @CRLF)
Local $tINFO = DllStructCreate($tagNMTREEVIEW, $lParam)
Local $hControl = DllStructGetData($tINFO, "NewhItem")
If _GUICtrlTreeView_GetExpanded($hWndTreeView, $hControl) = False Then
;ConsoleWrite(_GUICtrlTreeView_GetText($hWndFrom, $hControl) & @CRLF)
_ShellTreeView_GetSelected($hWndFrom, _GUICtrlTreeView_GetText($hWndFrom, $hControl), $hControl, False, False)
EndIf
EndSwitch
EndSwitch
;TristateTreeViewLib.au3
; ==========
Local $stNmhdr = DllStructCreate("dword;int;int", $lParam)
Local $hWndFrom = DllStructGetData($stNmhdr, 1)
Local $nNotifyCode = DllStructGetData($stNmhdr, 3)
Local $hItem = 0
; Check if its treeview and only NM_CLICK and TVN_KEYDOWN
If Not BitAND(GetWindowLong($hWndFrom, $GWL_STYLE), $TVS_CHECKBOXES) Or _
Not ($nNotifyCode = $NM_CLICK Or $nNotifyCode = $TVN_KEYDOWN) Then Return $GUI_RUNDEFMSG
If $nNotifyCode = $TVN_KEYDOWN Then
Local $lpNMTVKEYDOWN = DllStructCreate("dword;int;int;short;uint", $lParam)
; Check for 'SPACE'-press
If DllStructGetData($lpNMTVKEYDOWN, 4) <> $VK_SPACE Then Return $GUI_RUNDEFMSG
$hItem = SendMessage($hWndFrom, $TVM_GETNEXTITEM, $TVGN_CARET, 0)
Else
Local $Point = DllStructCreate("int;int")
GetCursorPos($Point)
ScreenToClient($hWndFrom, $Point)
; Check if clicked on state icon
Local $tvHit = DllStructCreate("int;uint;dword")
DllStructSetData($tvHit, 1, DllStructGetData($Point, 1), 1)
DllStructSetData($tvHit, 1, DllStructGetData($Point, 2), 2)
$hItem = SendMessage($hWndFrom, $TVM_HITTEST, 0, DllStructGetPtr($tvHit))
If Not BitAND(DllStructGetData($tvHit, 2), $TVHT_ONITEMSTATEICON) Then Return $GUI_RUNDEFMSG
EndIf
If $hItem > 0 Then
Local $nState = GetItemState($hWndFrom, $hItem)
$bCheckItems = 1
If $nState = 2 Then
$nState = 0
ElseIf $nState = 3 Then
$nState = 1
ElseIf $nState > 3 Then
$nState = $nState - 1
$bCheckItems = 0
EndIf
SetItemState($hWndFrom, $hItem, $nState)
$nState += 1
; If item are disabled there is no chance to change it and it's parents/children
If $bCheckItems Then
CheckParents($hWndFrom, $hItem, $nState)
CheckChildItems($hWndFrom, $hItem, $nState)
EndIf
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>MY_WM_NOTIFY_ShellTristateTreeView
:face (31): 晕哦我以为你帮忙解决我的难题!原来是灌水的~ 读了几遍楼主的问题,没明白到底什么意思 要求达到的效果是和这个一样的 http://www.autoitx.com/forum.php?mod=viewthread&tid=5725&rpid=133457&page=1#pid133457 本帖最后由 3mile 于 2010-2-12 16:25 编辑
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <file.au3>
#include <array.au3>
#include <GuiTreeView.au3>
#include <GuiButton.au3>
;#include <GuiImageList.au3>
#include <GuiListView.au3>
Opt("GUIOnEventMode", 1)
$iStyle = bitOR($LVS_ICON, $LVS_SINGLESEL, $LVS_NOCOLUMNHEADER)
$iExStyle = bitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE,$LVS_EX_CHECKBOXES,$LVS_EX_SUBITEMIMAGES,$LVS_EX_LABELTIP)
;Local $_INI_File = @ScriptDir & "\softinst.ini"
Dim $TreeView1,$ListView1
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 800, 600, 87, 50)
GUISetOnEvent($GUI_EVENT_CLOSE, "main")
$Pic1 = GUICtrlCreatePic("", 0, 0, 625, 97, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
;$TreeView1 = GUICtrlCreateTreeView(0, 96, 145, 281, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_NOTOOLTIPS, $TVS_TRACKSELECT, $TVS_SINGLEEXPAND, $TVS_INFOTIP, $TVS_FULLROWSELECT, $TVS_NOSCROLL, $TVS_NONEVENHEIGHT, $WS_GROUP, $WS_TABSTOP, $WS_HSCROLL, $WS_VSCROLL, $WS_BORDER), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
;GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$ListView1 = GUICtrlCreateListView("col1|col2", 144, 96, 580, 281,$iStyle,$iExStyle)
_GUICtrlListView_SetColumn($ListView1, 0, "New Column 1", 150, 0)
_GUICtrlListView_SetColumn($ListView1, 1, "New Column 2", 420, 0)
;_GUICtrlListView_SetExtendedListViewStyle($ListView1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES))
;$Button1 = GUICtrlCreateButton("Button1", 56, 368, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$type = IniReadSection("softinst.ini", "type")
Local $number=UBound($type)-1
;$hImage = _GUIImageList_Create(32, 32, 5, 3, 6)
;For $x = 1 To 8
; _GUIImageList_AddIcon($hImage, @ScriptDir&"\sort\"&$x&".ico", '', True)
;Next
;_ArrayDisplay($type)
Local $Button,$hImage
GUICtrlCreateGroup("",10,100,120,280)
For $i = 1 To UBound($type) - 1
$hImage[$i] = _GUIImageList_Create(32, 32, 5, 3, 6)
;MsgBox(0,0,UBound($type))
If $i=1 Then
$var=110
Else
$var=$i*(265/$number)+110-(265/$number)
EndIf
_GUIImageList_AddIcon($hImage[$i], @ScriptDir&"\sort\"&$i&".ico", '', True)
$Button[$i] = GUICtrlCreateButton($type[$i],12,$var,115,265/$number)
GUICtrlSetOnEvent($Button[$i], "main")
_GUICtrlButton_SetImageList($Button[$i], $hImage[$i],0)
;_GUIImageList_Remove($hImage, 0)
Next
While 1
Sleep(1000)
WEnd
Func main()
For $i = 1 To $number
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $Button[$i]
;MsgBox(0, "", "button" & $i)
$list=GUICtrlRead($Button[$i])
$listlist=IniReadSection("softinst.ini",$list&".list")
;_ArrayDisplay($listlist)
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView1))
For $b=0 To $listlist
If $listlist[$b]='' Then
;_GUICtrlListView_DeleteAllItems($ListView1)
Else
;_GUICtrlListView_SetExtendedListViewStyle($ListView1, $iExStyle)
_GUICtrlListView_AddItem($ListView1,$listlist[$b])
$workingdir=IniRead("softinst.ini",$listlist[$b],"WorkingDir","error")
$IconPath=IniRead("softinst.ini",$listlist[$b],"IconPath","error")
$Checked=IniRead("softinst.ini",$listlist[$b],"Checked","error")
$AutoInstall=IniRead("softinst.ini",$listlist[$b],"AutoInstall","error")
$ManualInstall=IniRead("softinst.ini",$listlist[$b],"ManualInstall","error")
$Description=IniRead("softinst.ini",$listlist[$b],"Description","error")
_GUICtrlListView_AddSubItem($ListView1,$b-1,$Description,1)
EndIf
Next
EndSwitch
Next
EndFunc ;==>main
Func listview()
While 1
$msg = GUIGetMsg()
Select
Case $msg = -3 Or $msg = -1
ExitLoop
;Case $msg = $aboutitem
;Case $msg = $effectitem
;Case $msg = $styleitem
EndSelect
WEnd
EndFunc
看看这段代码对楼主有用没有
softinst.ini如下 :
MainWidth=810
MainHeight=650
TitleText=3mile软件自动安装器
SavePath=0
Default=1
Countdown=15
1=系统辅助
2=影音图像
3=办公应用
4=光盘磁盘
5=上传下载
6=聊天游戏
7=网络浏览
8=实用软件
[系统辅助]
WorkingDir=%CurrDir%
IconPath=Sort\1.ico
[系统辅助.List]
List1=系统维护工具包
List2=WinRAR 3.90 简体中文注册版
List3=宽带拨号连接
List4=一键GHOST V2009.09.09 正式版
List5=右键添上“显示/隐藏系统文件+扩展名”菜单
[系统维护工具包]
WorkingDir=%CurrDir%
IconPath=files\tool\ico.ico
Checked=1
AutoInstall=files\tool\维护工具包.exe
ManualInstall=files\tool\维护工具包.exe
Description=包括:硬件检测、一键备份还原、OEM自定义、输入法设置工具等,让装机维护更方便!
WorkingDir=%CurrDir%
IconPath=files\winrar\ico.ico
Checked=1
AutoInstall=files\winrar\winrar.exe /s
ManualInstall=files\winrar\winrar.exe
Description=WinRAR 是强大的压缩文件管理器.它提供了 RAR 和 ZIP 文件的完整支持,已整合了最新补丁.推荐安装,装机必备!(自动安装时无界面)
[宽带拨号连接]
WorkingDir=%CurrDir%
IconPath=files\adsl\ico.ico
Checked=0
AutoInstall=files\adsl\adsl.exe /s
ManualInstall=files\adsl\adsl.exe
Description=这是一款一键安装宽带拨号连接的实用小工具,推荐使用宽带上网的朋友安装.(自动安装时无界面)
[右键添上“显示/隐藏系统文件+扩展名”菜单]
WorkingDir=%CurrDir%
IconPath=files\SuperHidden\ico.ico
Checked=0
AutoInstall=files\SuperHidden\SuperHidden.exe /s
ManualInstall=files\SuperHidden\SuperHidden.exe
Description=是一款为右键添上“显示/隐藏系统文件+扩展名”菜单的小工具.
[一键GHOST V2009.09.09 正式版]
WorkingDir=%CurrDir%
IconPath=files\GHOST\ico.ico
Checked=0
AutoInstall=files\GHOST\自动安装.exe
ManualInstall=files\GHOST\一键GHOST硬盘版.exe
Description=一键GHOST,高智能的GHOST,只需按一下"K"键,就能实现全自动无人值守操作,让你一爽到底.
[影音图像]
WorkingDir=%CurrDir%
IconPath=Sort\2.ico
[影音图像.List]
List1=暴风影音2009 特别版
List2=PPS网络电视 V2.6.86.8800
List3=千千静听 5.5.2 去广告绿色版
List4=Winamp V5.552 简体中文增强版
List5=KMPlayer V2.9.4
List6=ACDSee 3.1 经典美化版
[暴风影音2009 特别版]
WorkingDir=%CurrDir%
IconPath=files\Storm\ico.ico
Checked=1
AutoInstall=files\Storm\Storm.exe /Verysilent
ManualInstall=files\Storm\Storm.exe
Description=暴风影音是一款拥有全新自主技术的万能播放器,其独创的媒体专家让播放更流畅、更清晰.
WorkingDir=%CurrDir%
IconPath=files\PPS网络电视\ico.ico
Checked=0
AutoInstall=files\PPS网络电视\Setup.exe /S
ManualInstall=files\PPS网络电视\Setup.exe
Description=是一套完整的基于 P2P 技术的流媒体大规模应用的网络视频软件.
[千千静听 5.5.2 去广告绿色版]
WorkingDir=%CurrDir%
IconPath=files\千千静听\ico.ico
Checked=0
AutoInstall=files\千千静听\自动安装.exe /S
ManualInstall=files\千千静听\ttpsetup.exe
Description=千千静听是一款完全免费的音乐播放软件,集播放、音效、转换、歌词等众多功能于一身.
WorkingDir=%CurrDir%
IconPath=files\Winamp\ico.ico
Checked=0
AutoInstall=files\Winamp\Setup.exe /S
ManualInstall=files\Winamp\Setup.exe
Description=非常著名的高保真音乐播放软件,支持多种音频格式,可以定制界面.
WorkingDir=%CurrDir%
IconPath=files\KMPlayer\ico.ico
Checked=1
AutoInstall=files\KMPlayer\自动安装.exe
ManualInstall=files\KMPlayer\Setup.exe
Description=是一套将网络上所有能见得到的解码程式(Codec)全部收集于一身的影音全能播放器。几乎可以播放您系统上所有的影音文件.
WorkingDir=%CurrDir%
IconPath=files\acdsee\ico.ico
Checked=1
AutoInstall=files\acdsee\自动安装.exe
ManualInstall=files\acdsee\acdsee.exe
Description=ACDSee是目前最流行的数字图象处理软件,它能广泛应用于图片的获取、管理、浏览、优化.
[办公应用]
WorkingDir=%CurrDir%
IconPath=Sort\3.ico
[办公应用.List]
List1=Microsoft Office2003 sp3四合一
List2=搜狗拼音输入法 v4.2 去广告版
List3=搜狗五笔输入法 v1.5 官方正式版
List4=极点五笔 v6.5
List5=Foxit PDF 电子书阅读器
WorkingDir=%CurrDir%
IconPath=files\office\ico.ico
Checked=1
AutoInstall=files\office\自动安装.exe
ManualInstall=files\office\OFFICE2003.EXE
Description=包含四大组件:WORD、EXCEL、PowerPoint、Access及常用工具,通过正版验证,整合了最新的OFFICE补丁.
[搜狗拼音输入法 v4.2 去广告版]
WorkingDir=%CurrDir%
IconPath=files\sogou\ico.ico
Checked=1
AutoInstall=files\sogou\sogou_pinyin.exe /S
ManualInstall=files\sogou\sogou_pinyin.exe
Description=搜狗拼音输入法是的一款基于搜索引擎技术的、特别适合网民使用的、新一代的输入法产品.
[搜狗五笔输入法 v1.5 官方正式版]
WorkingDir=%CurrDir%
IconPath=files\搜狗五笔\ico.ico
Checked=0
AutoInstall=files\搜狗五笔\sogou_wubi_15b.exe /S
ManualInstall=files\搜狗五笔\sogou_wubi_15b.exe
Description=搜狗五笔输入法是的一款基于搜索引擎技术的、特别适合网民使用的、新一代的输入法产品.
[极点五笔 v6.5]
WorkingDir=%CurrDir%
IconPath=files\jdwb\ico.ico
Checked=0
AutoInstall=files\jdwb\Freeime.exe /s
ManualInstall=files\jdwb\Freeime.exe
Description=极点是一款免费的多功能五笔拼音输入软件.输入法能够稳定于主流Windows操作系统,且操作简单,配置灵活.
WorkingDir=%CurrDir%
IconPath=files\FoxitPDF\ico.ico
Checked=0
AutoInstall=files\FoxitPDF\FoxitReader.exe -y -o
ManualInstall=files\FoxitPDF\FoxitReader.exe
Description=一款 PDF文档阅读软件,它具有比官方软件 Adobe Reader 更加小巧的身材,更加快速的速度.
[光盘磁盘]
WorkingDir=%CurrDir%
IconPath=Sort\4.ico
[光盘磁盘.List]
List1=Nero V9.0 绿色注册版
List2=UltraISO 9.5.3.2716 注册版
List3=VDM绿色虚拟光驱 1.3.1
List4=Prassi ONES 光盘刻录
List5=启动易(EasyBoot) 5.10
WorkingDir=%CurrDir%
IconPath=files\Nero9\ico.ico
Checked=1
AutoInstall=files\Nero9\Setup.exe /S
ManualInstall=files\Nero9\Setup.exe
Description=Nero 可让您以轻松快速的方式制作您专属的 CD 和 DVD.
WorkingDir=%CurrDir%
IconPath=files\ULTRAISO\ico.ico
Checked=0
AutoInstall=files\ULTRAISO\UltraISO.9.5.3.2716.exe
ManualInstall=files\ULTRAISO\UltraISO.9.5.3.2716.exe
Description=UltraISO是一款功能强大而又方便实用的光盘映像文件制作/编辑/转换工具.
WorkingDir=%CurrDir%
IconPath=files\vdm\ico.ico
Checked=0
AutoInstall=files\vdm\vdm.exe -y -o
ManualInstall=files\vdm\vdm.exe
Description=绿色虚拟光驱是一款绿色虚拟光驱软件,感觉比Daemon Tool还方便.
WorkingDir=%CurrDir%
IconPath=files\ones\ico.ico
Checked=0
AutoInstall=files\ones\ones.exe -y -o
ManualInstall=files\ones\ones.exe
Description=一款高品质的数字刻录工具.支持CD-ROM、CD、视频文件、MP3, WMA 或 WAV等.可自动识别错误.
[启动易(EasyBoot) 5.10]
WorkingDir=%CurrDir%
IconPath=files\easyboot\ico.ico
Checked=0
AutoInstall=files\easyboot\EASYBOOT.exe /silent
ManualInstall=files\easyboot\EASYBOOT.exe
Description=一款集成化的中文启动光盘制作工具,它可以制作光盘启动菜单、自动生成启动文件、并生成可启动ISO文件.
[上传下载]
WorkingDir=%CurrDir%
IconPath=Sort\5.ico
[上传下载.List]
List1=迅雷v5.9.7.1062去广告VIP破解烈火版
List2=FlashFXP 3.6.0
List3=BitComet(比特彗星) V1.13
List4=比特精灵(BitSpirit) V3.5.0.275 中文版
List5=纳米机器人 V2.0 去广告绿色版
[迅雷v5.9.7.1062去广告VIP破解烈火版]
WorkingDir=%CurrDir%
IconPath=files\thunder5\ico.ico
Checked=1
AutoInstall=files\thunder5\Thunder5.9.7.1062.exe /Verysilent
ManualInstall=files\thunder5\Thunder5.9.7.1062.exe
Description=迅雷是一款新型的基于多资源超线程技术的下载软件,作为“宽带时期的下载工具.
WorkingDir=%CurrDir%
IconPath=files\FLASHFXP\ico.ico
Checked=0
AutoInstall=files\FLASHFXP\FLASHFXP.EXE /s
ManualInstall=files\FLASHFXP\FLASHFXP.EXE
Description=采用多服务器超线程技术、全面支持多种协议,具有优秀的文件管理功能.
WorkingDir=%CurrDir%
IconPath=files\BitComet\ico.ico
Checked=1
AutoInstall=files\BitComet\Setup.exe /S
ManualInstall=files\BitComet\Setup.exe
Description=是一个完全免费的BitTorrent(BT)下载管理软件,也称BT下载客户端,同时也是一个集BT/HTTP/FTP为一体的下载管理器.
[比特精灵(BitSpirit) V3.5.0.275 中文版]
WorkingDir=%CurrDir%
IconPath=files\比特精灵\ico.ico
Checked=0
AutoInstall=files\比特精灵\Setup.exe /S
ManualInstall=files\比特精灵\Setup.exe
Description=是一款完全免费、高速稳定、功能强大、不包含广告的BT下载软件。自发布以来以其稳定高速,功能强大,使用人性化的特点,日益受到广大用户的青睐.
[纳米机器人 V2.0 去广告绿色版]
WorkingDir=%CurrDir%
IconPath=files\纳米机器人\ico.ico
Checked=1
AutoInstall=files\纳米机器人\自动安装.exe
ManualInstall=files\纳米机器人\nami.exe
Description=批量上传下载; 单次不限文件数及总大小; 支持4G的超大文件上传;支持断点续传; 支持http下载并贮存于纳米盘.
[聊天游戏]
WorkingDir=%CurrDir%
IconPath=Sort\6.ico
[聊天游戏.List]
List1=腾讯QQ2009正式版SP4(去广告版,自动安装默认D盘)
List2=QQGame 2009Beta6P1 最新版(自动安装默认D盘)
List3=飞信2008 V3.5 官方正式版(去广告,自动安装默认D盘)
List4=联众世界 v2.8.4.1 正式版
[腾讯QQ2009正式版SP4(去广告版,自动安装默认D盘)]
WorkingDir=%CurrDir%
IconPath=files\QQ\ico.ico
Checked=1
AutoInstall=files\QQ\自动安装.exe
ManualInstall=files\QQ\QQ2009SP4.exe
Description=腾讯QQ2009正式版SP4,没有附带任何广告,推荐使用,默认安装到D盘,避免资料丢失.
WorkingDir=%CurrDir%
IconPath=files\QQ游戏\ico.ico
Checked=1
AutoInstall=files\QQ游戏\自动安装.exe
ManualInstall=files\QQ游戏\QQGame2009Beta6P1.EXE
Description=牌类游戏(33款),麻将类游戏(11款),休闲竞技类(16款),棋类游戏(8款),手机游戏(7款).
[飞信2008 V3.5 官方正式版(去广告,自动安装默认D盘)]
WorkingDir=%CurrDir%
IconPath=files\feixin\ico.ico
Checked=0
AutoInstall=files\feixin\自动安装.exe
ManualInstall=files\feixin\fetion2008_6138.exe
Description=飞信是中国移动推出的“综合通信服务”,即融合语音(IVR)、GPRS、短信等多种通信方式,覆盖三种不同形态(完全实时、准实时和非实时)的客户通信需求,实现互联网和移动网间的无缝通信服务.
[联众世界 v2.8.4.1 正式版]
WorkingDir=%CurrDir%
IconPath=files\联众世界\ico.ico
Checked=0
AutoInstall=files\联众世界\自动安装.exe
ManualInstall=files\联众世界\联众世界2.8.4.1正式版.exe
Description=提供网络棋牌,对战,休闲等在线游戏的综合网络休闲娱乐平台.包括游戏下载,游戏攻略,游戏资讯,社区互动,无线增值,比赛竞技等.
[网络浏览]
WorkingDir=%CurrDir%
IconPath=Sort\7.ico
[网络浏览.List]
List1=世界之窗 V3.0.5.9 最新正式版
List2=傲游浏览器(Maxthon) V2.5.3 最新正式版
List3=腾讯TT浏览器 V4.6.1(424)
List4=Firefox(火狐) V3.5 RC1 简体中文版
[世界之窗 V3.0.5.9 最新正式版]
WorkingDir=%CurrDir%
IconPath=files\世界之窗\ico.ico
Checked=1
AutoInstall=files\世界之窗\Setup.exe /S
ManualInstall=files\世界之窗\Setup.exe
Description=是一款小巧、快速、安全、功能强大的多窗口浏览器,它是完全免费,没有任何功能限制的绿色软件.
[傲游浏览器(Maxthon) V2.5.3 最新正式版]
WorkingDir=%CurrDir%
IconPath=files\Maxthon\ico.ico
Checked=0
AutoInstall=files\Maxthon\Setup.exe /S
ManualInstall=files\Maxthon\Setup.exe
Description=是一款基于 IE 内核的、多功能、个性化多页面浏览器.
[腾讯TT浏览器 V4.6.1(424)]
WorkingDir=%CurrDir%
IconPath=files\腾讯TT\ico.ico
Checked=0
AutoInstall=files\腾讯TT\Setup.exe /S
ManualInstall=files\腾讯TT\Setup.exe
Description=是一款集多线程、黑白名单、智能屏蔽、鼠标手势等功能于一体的多页面浏览器,具有快速、稳定、安全的特点.
WorkingDir=%CurrDir%
IconPath=files\Firefox\ico.ico
Checked=0
AutoInstall=files\Firefox\Setup.exe /S
ManualInstall=files\Firefox\Setup.exe
Description=是一个自由的,开放源码的浏览器,适用于 Windows, Linux 和 MacOS X平台.
[实用软件]
WorkingDir=%CurrDir%
IconPath=Sort\8.ico
[实用软件.List]
List1=查查看2.0 正式版
List2=360安全卫士 6.0.1003 最新版
List3=NOD32 自动获取ID 无限升级版
List4=鲁大师 v2.39 最新版
List5=Cpu-Z V1.5.2
List6=Windows优化大师 V7.96
List7=Vista优化大师 V3.6.2 正式版
List8=E-钻文件夹加密大师 注册版
List9=大智慧经典版 V6.0 官方安装版
List10=一键清理优化选项
List11=自动清除多余开机启动项
[查查看2.0 正式版]
WorkingDir=%CurrDir%
IconPath=files\查查看\ico.ico
Checked=1
AutoInstall=files\查查看\自动安装.exe
ManualInstall=files\查查看\cha_lhm8_6138.exe
Description=是一款功能强大、方便易用的生活搜索服务软件,快速查找各类信息,很实用.
WorkingDir=%CurrDir%
IconPath=files\360\ico.ico
Checked=1
AutoInstall=files\360\自动安装.exe
ManualInstall=files\360\setupbeta.exe
Description=360安全卫士用来清理流氓软件,插件,系统清理,修改,更新补丁等.
WorkingDir=%CurrDir%
IconPath=files\NOD32\ico.ico
Checked=0
AutoInstall=files\NOD32\自动安装.exe
ManualInstall=files\NOD32\EAV_3.0.685.exe
Description=目前最好的防御。它能提供最大的防毒及反间谍保护,而不影响您的计算机性能.
[鲁大师 v2.39 最新版]
WorkingDir=%CurrDir%
IconPath=files\鲁大师\ico.ico
Checked=0
AutoInstall=files\鲁大师\自动安装.exe
ManualInstall=files\鲁大师\Setup.exe
Description=拥有专业而易用的硬件检测,不仅超级准确,而且向你提供中文厂商信息,让你的电脑配置一目了然.
WorkingDir=%CurrDir%
IconPath=files\Cpu-Z\ico.ico
Checked=0
AutoInstall=files\Cpu-Z\Setup.exe /S
ManualInstall=files\Cpu-Z\Setup.exe
Description=一款家喻户晓的CPU检测软件,除了使用Intel或AMD自己的检测软件之外,我们平时使用最多的此类软件就数它了.
WorkingDir=%CurrDir%
IconPath=files\Vista优化大师\ico.ico
Checked=0
AutoInstall=files\Vista优化大师\Setup.exe /S
ManualInstall=files\Vista优化大师\Setup.exe
Description=微软Windows Vista系统优化中的瑞士军刀,中国国内第一个专业优化微软Windows Vista的超级工具.
[超级兔子 v9.0 beta3 标准版]
WorkingDir=%CurrDir%
IconPath=files\超级兔子\ico.ico
Checked=0
AutoInstall=files\超级兔子\自动安装.exe
ManualInstall=files\超级兔子\Setup.exe
Description=是一个完整的系统维护工具,可能清理你大多数的文件、注册表里面的垃圾,同时还有强力的软件卸载功能,专业的卸载可以清理一个软件在电脑内的所有记录.
WorkingDir=%CurrDir%
IconPath=files\Windows优化大师\ico.ico
Checked=0
AutoInstall=files\Windows优化大师\Setup.exe /S
ManualInstall=files\Windows优化大师\Setup.exe
Description=是一款功能强大的系统辅助软件,它提供了全面有效且简便安全的系统检测、系统优化、系统清理、系统维护四大功能模块及数个附加的工具软件.
WorkingDir=%CurrDir%
IconPath=files\E-钻文件夹加密大师\ico.ico
Checked=0
AutoInstall=files\E-钻文件夹加密大师\E-钻文件夹加密大师.exe /S
ManualInstall=files\E-钻文件夹加密大师\E-钻文件夹加密大师.exe
Description=可以加密任意的文件和文件夹,并且支持驱动器.采用多种加密方式,让您的文件拥有钻石般的硬度.无懈可击!.
[大智慧经典版 V6.0 官方安装版]
WorkingDir=%CurrDir%
IconPath=files\大智慧\ico.ico
Checked=0
AutoInstall=files\大智慧\Dzh_Ver6.0.exe /sp- /verysilent /suppressmsgboxes /norestart
ManualInstall=files\大智慧\Dzh_Ver6.0.exe
Description=市场变了,行情变了,分析方法变了,使用大智慧,紧跟市场变化!.
[一键清理优化选项]
WorkingDir=%CurrDir%
IconPath=files\reg\ico.ico
Checked=0
AutoInstall=files\reg\一键清理优化.exe
ManualInstall=files\reg\一键清理优化.exe
Description=本批处理用来自动清理多余广告类快捷方式,恢复设置IE默认主页为网址导航.
[自动清除多余开机启动项]
WorkingDir=%CurrDir%
IconPath=files\reg\ico.ico
Checked=0
AutoInstall=files\reg\清理多余启动项.bat
ManualInstall=files\reg\清理多余启动项.bat
Description=本注册表用来自动清除多余开机启动项.
你这段代码没有用_GUICtrlListBox 不合我用。 ListView,先看看吧!#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
$Debug_LV = False ; 检查传递给函数的类名, 设置为真并使用另一控件句柄观察其工作
Global $hListView, $edit, $sa, $txit, $a, $Check
Local $GUI, $hImage
$GUI = GUICreate("(UDF Created) ListView Create", 500, 380)
$hListView = GUICtrlCreateListView('文件', 2, 2, 200, 330, $WS_BORDER)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_SetView($hListView, 3);设置样式,可选(1、2、3、4)
$edit = GUICtrlCreateEdit("", 250, 2, 240, 330)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES))
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
; 添加列
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 180)
; 添加项
For $i = 0 To 10
_GUICtrlListView_AddItem($hListView, "项目-" & $i, $i)
Next
; 循环至用户退出
While 1
$a = _GUICtrlListView_GetItemCount($hListView)
For $i = 0 To $a
$Check = _GUICtrlListView_GetItemChecked($hListView, $i)
If $Check = True Then
$txit &= _GUICtrlListView_GetItemText($hListView, $i) & @CRLF
EndIf
Next
If $txit <> $sa Then
GUICtrlSetData($edit, '')
GUICtrlSetData($edit, $txit, 1)
$sa = $txit
EndIf
$txit = ''
Switch GUIGetMsg()
Case -3
Exit
EndSwitch
WEnd
UDF函数经常出现对中文支持不好,容易乱码!我遇到好几次。 #include <GuiListView.au3>
#include <GuiImageList.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>
Opt('MustDeclareVars', 1)
$Debug_LV = False ; 检查传递给函数的类名, 设置为真并使用另一控件句柄观察其工作
Global $hListView, $edit, $sa, $txit, $a, $Check
Local $GUI, $hImage
$GUI = GUICreate("(UDF Created) ListView Create", 500, 380)
$hListView = GUICtrlCreateListView('文件', 2, 2, 200, 330, $WS_BORDER)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_SetView($hListView, 3);设置样式,可选(1、2、3、4)
;$edit = GUICtrlCreateEdit("", 250, 2, 240, 330)
$edit = GUICtrlCreateList("", 250, 2, 240, 330)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES))
GUISetState()
; 添加列
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 180)
; 添加项
For $i = 0 To 10
_GUICtrlListView_AddItem($hListView, "项目-" &StringFormat("[%02d] : Random string", $i), $i)
Next
; 循环至用户退出
While 1
$a = _GUICtrlListBox_GetCount($hListView)
For $i = 0 To $a
$Check = _GUICtrlListBox_GetText($hListView, $i)
If $Check = True Then
$txit &= _GUICtrlListBox_GetSelItemsText($hListView, $i) & @CRLF
EndIf
Next
If $txit <> $sa Then
_GUICtrlListBox_AddString($edit, '')
_GUICtrlListBox_AddString($edit, $txit, 1)
;GUICtrlSetData
$sa = $txit
EndIf
$txit = ''
Switch GUIGetMsg()
Case -3
Exit
EndSwitch
WEnd有时间帮忙看看那个函数用错了 以上代码不会添加到GUICtrlCreateList
祝论坛的所有成员 新年快乐! 祝论坛的所有成员 新年快乐!情人节快乐! 谢谢共享了
zxxpt 发表于 2010-2-16 09:28 http://www.autoitx.com/images/common/back.gif
晕啊,共享了什么呢? 我的问题还没有解决啊! $sa是个什么东西,前面没定义怎么就检查是否相同了 $sa是个什么东西,前面没定义怎么就检查是否相同了
netegg 发表于 2010-2-16 16:50 http://www.autoitx.com/images/common/back.gif
$sa 之前是空的,当有勾选时 $txit <> $sa 这时就修改,修改完后$sa = $txit 祝论坛的所有成员 新年快乐!
页:
[1]
2