找回密码
 加入
搜索
查看: 1263|回复: 3

提问 怎么解决分页标签对话框问题

[复制链接]
发表于 2009-10-11 16:53:40 | 显示全部楼层 |阅读模式
本帖最后由 xxxlll2007 于 2009-11-5 04:42 编辑

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
$Form1_1 = GUICreate("分页标签对话框", 411, 319, 205, 135)
GUISetIcon("D:\005.ico")
$PageControl1 = GUICtrlCreateTab(9, 9, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("list-1")
$ListView1 = GUICtrlCreateListView("", 24, 48, 361, 169)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$listview1=gui()
$Button4 = GUICtrlCreateButton("删除启动项", 55, 225, 75, 25, 0)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Button5 = GUICtrlCreateButton("查看启动项", 278, 225, 75, 25, 0)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem("list-2")
$Checkbox1 = GUICtrlCreateCheckbox("自动结束无响应程序", 24, 49, 137, 19)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox2 = GUICtrlCreateCheckbox("自动结束无响应服务", 24, 83, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox3 = GUICtrlCreateCheckbox("卸载当前不使用的DLL", 24, 116, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox4 = GUICtrlCreateCheckbox("加快程序响应速度", 24, 150, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox5 = GUICtrlCreateCheckbox("禁止IE自动安装组件", 24, 183, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox6 = GUICtrlCreateCheckbox("加快菜单显示速度", 24, 217, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox7 = GUICtrlCreateCheckbox("启动预读减少启动时间", 237, 49, 137, 19)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox8 = GUICtrlCreateCheckbox("加速IE网页浏览速度", 237, 83, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox9 = GUICtrlCreateCheckbox("加大图标缓存", 237, 116, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox10 = GUICtrlCreateCheckbox("关闭系统文件保护", 237, 150, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox11 = GUICtrlCreateCheckbox("打开启动优化功能", 237, 183, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox12 = GUICtrlCreateCheckbox("最大化文件缓存", 237, 217, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$TabSheet3 = GUICtrlCreateTabItem("list-3")
$Checkbox13 = GUICtrlCreateCheckbox("加速程序运行及秒退", 24, 50, 138, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox14 = GUICtrlCreateCheckbox("彻底关闭华医生", 24, 82, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox15 = GUICtrlCreateCheckbox("防止IE异常(自动关闭等)", 24, 114, 150, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox16 = GUICtrlCreateCheckbox("共享VBS,BAT无提示", 24, 146, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox17 = GUICtrlCreateCheckbox("减少浏览器与程序假死几率", 24, 178, 180, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox18 = GUICtrlCreateCheckbox("快速响应应用程序请求", 24, 210, 145, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox19 = GUICtrlCreateCheckbox("清除DLL缓存加速系统", 237, 50, 145, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox20 = GUICtrlCreateCheckbox("禁止错误报告", 237, 82, 113, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox21 = GUICtrlCreateCheckbox("防止键盘无应答", 237, 114, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox22 = GUICtrlCreateCheckbox("清理日韩语加速系统", 237, 146, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox23 = GUICtrlCreateCheckbox("清除帮助文件加速系统", 237, 178, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox24 = GUICtrlCreateCheckbox("系统崩溃强制重启", 237, 210, 129, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$TabSheet4 = GUICtrlCreateTabItem("list-4")
GUICtrlSetState(1,$GUI_SHOW)
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("确定(&O)", 55, 280, 80, 28, 0)
$Button2 = GUICtrlCreateButton("取消(&C)", 278, 280, 80, 28, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $Msg = GUIGetMsg()
            If $msg=$Button4 Then
                        Call ("kill")
                EndIf
                If $msg=$Button5 Then
                        Call ("gui")
                EndIf
                If $msg=$GUI_EVENT_CLOSE Then
                        Exit
                EndIf
WEnd

func gui()
if $ListView1 then GUICtrlDelete($ListView1)
$ListView1 = GUICtrlCreateListView("编号 |启动项值     |完整执行路径                 ", 24, 48, 361, 169)
$i=1
while 1
$r=RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$i)
$r2=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$r)
if $r2 <> "" or $r="" Then
   $i=$i+1
Else
   exitloop
EndIf
GUICtrlCreateListViewItem("      "&$i-1&"|"&$r&"|"&$r2,$listview1)
WEnd

$p=1
while 1
$w=RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce",$p)
$w2=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce",$w)
if $w2 <> "" or $w="" Then
   $p=$p+1
Else
   exitloop
EndIf
GUICtrlCreateListViewItem("      "&$p-1+$i-1&"|"&$w&"|"&$w2,$listview1)
WEnd


$s=1
while 1
$e=RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx",$s)
$e2=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx",$e)
if $e2 <> "" or $e="" Then
   $s=$s+1
Else
   exitloop
EndIf
GUICtrlCreateListViewItem("      "&$s-1+$i-1+$p-1&"|"&$e&"|"&$e2,$listview1)
WEnd

$u=1
while 1
$uy=RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run",$u)
$uy2=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run",$uy)
if $uy2 <> "" or $uy="" Then
   $u=$u+1
Else
   exitloop
EndIf
GUICtrlCreateListViewItem("      "&$s-1+$i-1+$p-1+$u-1&"|"&$uy&"|"&$uy2,$listview1)
WEnd

$l=1
while 1
$ur=RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce",$l)
$ur2=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce",$ur)
if $ur2 <> "" or $ur="" Then
   $l=$l+1
Else
   exitloop
EndIf
GUICtrlCreateListViewItem("      "&$s-1+$i-1+$p-1+$u-1+$l-1&"|"&$ur&"|"&$ur2,$listview1)
WEnd
return $ListView1
EndFunc


func kill()
$read0=GUICtrlRead(GUICtrlRead($listview1))
if $read0 = 0 Then
$read=StringSplit($read0,"|")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$read[2])
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce",$read[2])
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx",$read[2])
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run",$read[2])
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce",$read[2])
endif
Return gui()
EndFunc
刷新后,点其它分页标签,会被listview 覆盖!
希望高手帮忙解决一下!
 楼主| 发表于 2009-10-11 16:54:51 | 显示全部楼层
自己顶先
发表于 2009-10-11 17:31:26 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>

$Form1_1 = GUICreate("分页标签对话框", 411, 319, 205, 135)
GUISetIcon("D:\005.ico")
$PageControl1 = GUICtrlCreateTab(9, 9, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("list-1")
$ListView1 = GUICtrlCreateListView("", 24, 48, 361, 169)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$ListView1 = gui()
$Button4 = GUICtrlCreateButton("删除启动项", 55, 225, 75, 25, 0)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Button5 = GUICtrlCreateButton("查看启动项", 278, 225, 75, 25, 0)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem("list-2")
$Checkbox1 = GUICtrlCreateCheckbox("自动结束无响应程序", 24, 49, 137, 19)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox2 = GUICtrlCreateCheckbox("自动结束无响应服务", 24, 83, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox3 = GUICtrlCreateCheckbox("卸载当前不使用的DLL", 24, 116, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox4 = GUICtrlCreateCheckbox("加快程序响应速度", 24, 150, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox5 = GUICtrlCreateCheckbox("禁止IE自动安装组件", 24, 183, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox6 = GUICtrlCreateCheckbox("加快菜单显示速度", 24, 217, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox7 = GUICtrlCreateCheckbox("启动预读减少启动时间", 237, 49, 137, 19)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox8 = GUICtrlCreateCheckbox("加速IE网页浏览速度", 237, 83, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox9 = GUICtrlCreateCheckbox("加大图标缓存", 237, 116, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox10 = GUICtrlCreateCheckbox("关闭系统文件保护", 237, 150, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox11 = GUICtrlCreateCheckbox("打开启动优化功能", 237, 183, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox12 = GUICtrlCreateCheckbox("最大化文件缓存", 237, 217, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$TabSheet3 = GUICtrlCreateTabItem("list-3")
$Checkbox13 = GUICtrlCreateCheckbox("加速程序运行及秒退", 24, 50, 138, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox14 = GUICtrlCreateCheckbox("彻底关闭华医生", 24, 82, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox15 = GUICtrlCreateCheckbox("防止IE异常(自动关闭等)", 24, 114, 150, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox16 = GUICtrlCreateCheckbox("共享VBS,BAT无提示", 24, 146, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox17 = GUICtrlCreateCheckbox("减少浏览器与程序假死几率", 24, 178, 180, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox18 = GUICtrlCreateCheckbox("快速响应应用程序请求", 24, 210, 145, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox19 = GUICtrlCreateCheckbox("清除DLL缓存加速系统", 237, 50, 145, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox20 = GUICtrlCreateCheckbox("禁止错误报告", 237, 82, 113, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox21 = GUICtrlCreateCheckbox("防止键盘无应答", 237, 114, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox22 = GUICtrlCreateCheckbox("清理日韩语加速系统", 237, 146, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox23 = GUICtrlCreateCheckbox("清除帮助文件加速系统", 237, 178, 137, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$Checkbox24 = GUICtrlCreateCheckbox("系统崩溃强制重启", 237, 210, 129, 17)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
$TabSheet4 = GUICtrlCreateTabItem("list-4")
GUICtrlSetState(1, $GUI_SHOW)
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("确定(&O)", 55, 280, 80, 28, 0)
$Button2 = GUICtrlCreateButton("取消(&C)", 278, 280, 80, 28, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$bj = 1
While 1
        if _GUICtrlTab_GetCurSel($PageControl1) = 0 And $bj = 1 then
                 GUICtrlSetState($ListView1, $GUI_SHOW)
                 $bj = 0
        Elseif _GUICtrlTab_GetCurSel($PageControl1) <> 0 And $bj = 0 Then
                 GUICtrlSetState($ListView1, $GUI_HIDE)
                 $bj = 1
        Endif
        Switch GUIGetMsg()
                Case - 3, $Button2
                        Exit
                Case $Button4
                        Call("kill")
                Case $Button5
                        Call("gui")
        EndSwitch
WEnd

Func gui()
        If $ListView1 Then GUICtrlDelete($ListView1)
        $ListView1 = GUICtrlCreateListView("编号 |启动项值     |完整执行路径                 ", 24, 48, 361, 169)
        $i = 1
        While 1
                $r = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)
                $r2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $r)
                If $r2 <> "" Or $r = "" Then
                        $i = $i + 1
                Else
                        ExitLoop
                EndIf
                GUICtrlCreateListViewItem("      " & $i - 1 & "|" & $r & "|" & $r2, $ListView1)
        WEnd

        $p = 1
        While 1
                $w = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce", $p)
                $w2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce", $w)
                If $w2 <> "" Or $w = "" Then
                        $p = $p + 1
                Else
                        ExitLoop
                EndIf
                GUICtrlCreateListViewItem("      " & $p - 1 + $i - 1 & "|" & $w & "|" & $w2, $ListView1)
        WEnd


        $s = 1
        While 1
                $e = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx", $s)
                $e2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx", $e)
                If $e2 <> "" Or $e = "" Then
                        $s = $s + 1
                Else
                        ExitLoop
                EndIf
                GUICtrlCreateListViewItem("      " & $s - 1 + $i - 1 + $p - 1 & "|" & $e & "|" & $e2, $ListView1)
        WEnd

        $u = 1
        While 1
                $uy = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", $u)
                $uy2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", $uy)
                If $uy2 <> "" Or $uy = "" Then
                        $u = $u + 1
                Else
                        ExitLoop
                EndIf
                GUICtrlCreateListViewItem("      " & $s - 1 + $i - 1 + $p - 1 + $u - 1 & "|" & $uy & "|" & $uy2, $ListView1)
        WEnd

        $l = 1
        While 1
                $ur = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce", $l)
                $ur2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce", $ur)
                If $ur2 <> "" Or $ur = "" Then
                        $l = $l + 1
                Else
                        ExitLoop
                EndIf
                GUICtrlCreateListViewItem("      " & $s - 1 + $i - 1 + $p - 1 + $u - 1 + $l - 1 & "|" & $ur & "|" & $ur2, $ListView1)
        WEnd
        Return $ListView1
EndFunc   ;==>gui


Func kill()
        $read0 = GUICtrlRead(GUICtrlRead($ListView1))
        If $read0 = 0 Then
                $read = StringSplit($read0, "|")
                RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $read[2])
                RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce", $read[2])
                RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx", $read[2])
                RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", $read[2])
                RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce", $read[2])
        EndIf
        Return gui()
EndFunc   ;==>kill
 楼主| 发表于 2009-10-11 19:09:43 | 显示全部楼层
谢谢!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-4 18:09 , Processed in 0.074593 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表