|
本帖最后由 QQ3131806 于 2010-11-25 13:25 编辑
问题如下:
1.在点击"常用工具,实用工具,启动管理"这几项之间切换都正常,但是当点击了"进程管理",或者"控制面板"的时候再切换到其它项,就会出现延迟,不知道为啥?
2.加了皮肤之后,带滚动条的地方不能正常显示,需要把鼠标放在上面或者点一下才能显示
3.正多次点击控制面板的时候,会造成CPU占用率过高,或者假死的现象,要不就是白屏,不能显示控制面板里的内容?不知道是否有更好的方法显示控制面板?
4.进程数那里需要点击之刷新进程之后才能正常显示,能否像windows的进程管理器一样,嘿嘿自己监控进程是否多了,然后自动跳动,不过估计这样会一直在监控进程,占用资源估计也不小,嘿嘿,方法我是想着每隔多久就刷新一下列表,但是及时性上来说估计不够?这个位置也可以算个鸡肋,不要也行,只不过是想学学东西才加上去的!出于实用性,也许不加更好.
5.启动管理里的图标还没有处理好,也还没有去做自动获取的动作,估计如果做了这个,可能会出现像BUG1一样的现象
6.还有一个需要实现的是,运行这个程序之后,默认显示"常用工具"里的内容
扩展:实现右键结束进程,跟右键删除启动项等操作
再加几张图好了,没图的话,怕有些哥们不看程序,头痛,众人拾柴火焰高,麻烦各位大大们提点修改意见,只是想学东西,我知道仿的很差劲,但是没有个参照物也不知道拿来做啥,第一次写,程序很乱,上面用到了皮肤,用到了父子窗口,这些都是在论坛里边找资料边学拼凑上去的,很多东西还不是很理解!见谅,天天在线,在论坛,我会时刻关注此贴子!
图片:
皮肤我做为附件上传吧,不过论坛里也有下载的#NoTrayIcon
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
#Include <WinAPIEx.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\user\桌面\新\form3.kxf
;整体框架
$Form1 = GUICreate("网吧维护工具", 684, 476, 190, 113)
Dim $Dll,$bf = @ScriptDir&"\vista_style.skf"
_SkinGUI(@ScriptDir&"\SkinCrafterDll_31.dll", $bf, $Form1)
$Group1 = GUICtrlCreateGroup("", 576, 0, 96, 470)
$Button1 = GUICtrlCreateButton("常用工具", 584, 17, 80, 34)
$Button2 = GUICtrlCreateButton("实用工具", 584, 84, 80, 34)
$Button3 = GUICtrlCreateButton("启动管理", 584, 151, 80, 34)
$Button4 = GUICtrlCreateButton("进程管理", 584, 218, 80, 34)
$Button5 = GUICtrlCreateButton("控制面板", 584, 285, 80, 34)
$Button6 = GUICtrlCreateButton("工具设置", 584, 352, 80, 34)
$Button7 = GUICtrlCreateButton("退出程序", 584, 419, 80, 34)
$Label1 = GUICtrlCreateLabel("某某网吧维护工具", 8, 32, 180, 25)
GUICtrlSetFont(-1, 16, 800, 0, "宋体")
$Button8 = GUICtrlCreateButton("预留位", 432, 32, 123, 25)
$Label2 = GUICtrlCreateLabel("| 本机:[PC-200912100922]", 288, 440, 166, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Label3 = GUICtrlCreateLabel("[192.168.0.11]", 464, 440, 105, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
;常用工具
$Form2 = GUICreate("常用工具", 547, 372, 15,60,$WS_CHILD,"",$Form1)
$bGroup1 = GUICtrlCreateGroup("常用工具", 0, 0, 545, 369)
$bButton1 = GUICtrlCreateButton("CMD", 8, 16, 163, 25)
$bButton2 = GUICtrlCreateButton("运行", 191, 16, 163, 25)
$bButton3 = GUICtrlCreateButton("服务", 374, 16, 163, 25)
$bButton4 = GUICtrlCreateButton("组策略", 8, 48, 163, 25)
$bButton5 = GUICtrlCreateButton("注册表", 191, 48, 163, 25)
$bButton6 = GUICtrlCreateButton("网络连接", 374, 48, 163, 25)
$bButton7 = GUICtrlCreateButton("计算机管理", 8, 80, 163, 25)
$bButton8 = GUICtrlCreateButton("刷新注册表", 191, 80, 163, 25)
$bButton9 = GUICtrlCreateButton("刷新组策略", 374, 80, 163, 25)
$bButton10 = GUICtrlCreateButton("设备管理器", 8, 112, 163, 25)
$bButton11 = GUICtrlCreateButton("控制面板", 191, 112, 163, 25)
$bButton12 = GUICtrlCreateButton("磁盘管理", 374, 112, 163, 25)
$bButton13 = GUICtrlCreateButton("禁止网卡", 8, 144, 163, 25)
$bButton14 = GUICtrlCreateButton("重启网卡", 191, 144, 163, 25)
$bButton15 = GUICtrlCreateButton("DirectX(DX)", 374, 144, 163, 25)
$bButton16 = GUICtrlCreateButton("Ipconfig", 8, 176, 163, 25)
$bButton17 = GUICtrlCreateButton("显示隐藏设备", 191, 176, 163, 25)
$bButton18 = GUICtrlCreateButton("重启Explorer", 374, 176, 163, 25)
$bButton19 = GUICtrlCreateButton("计算机名", 8, 208, 163, 25)
$bButton20 = GUICtrlCreateButton("获取公网IP", 191, 208, 163, 25)
$bButton21 = GUICtrlCreateButton("自动登录", 374, 208, 163, 25)
$bButton22 = GUICtrlCreateButton("显示隐藏文件", 8, 240, 163, 25)
$bButton23 = GUICtrlCreateButton("更改IP地址", 191, 240, 163, 25)
$bButton24 = GUICtrlCreateButton("文件夹选项", 374, 240, 163, 25)
$bButton25 = GUICtrlCreateButton("隐藏安全选项", 8, 272, 163, 25)
$bButton26 = GUICtrlCreateButton("语音测试", 191, 272, 163, 25)
$bButton27 = GUICtrlCreateButton("显卡优化", 374, 272, 163, 25)
$bButton28 = GUICtrlCreateButton("窗口置顶", 8, 304, 163, 25)
$bButton29 = GUICtrlCreateButton("快速关机", 191, 304, 163, 25)
$bButton30 = GUICtrlCreateButton("快速重启", 374, 304, 163, 25)
$bButton31 = GUICtrlCreateButton("PING", 192, 336, 75, 25)
$bButton32 = GUICtrlCreateButton("Tracert", 280, 336, 75, 25)
$bButton33 = GUICtrlCreateButton("打开磁盘分区↓", 374, 336, 163, 25)
$bCombo1 = GUICtrlCreateCombo("", 8, 336, 163, 25)
;实用工具
$Form3 = GUICreate("实用工具", 547, 372, 15, 60,$WS_CHILD,"",$Form1)
$cGroup1 = GUICtrlCreateGroup("实用工具", 0, 0, 545, 148)
$cButton1 = GUICtrlCreateButton("OEM设置", 8, 16, 163, 25)
$cButton2 = GUICtrlCreateButton("输入法设置", 191, 16, 163, 25)
$cButton3 = GUICtrlCreateButton("清理垃圾", 374, 16, 163, 25)
$cButton4 = GUICtrlCreateButton("星号查看", 8, 48, 163, 25)
$cButton5 = GUICtrlCreateButton("网络连接查看", 191, 48, 163, 25)
$cButton6 = GUICtrlCreateButton("磁盘管理工具", 374, 48, 163, 25)
$cButton7 = GUICtrlCreateButton("灰色按钮可见", 8, 80, 163, 25)
$cButton8 = GUICtrlCreateButton("驱动备份", 191, 80, 163, 25)
$cButton9 = GUICtrlCreateButton("卸载所有驱动", 374, 80, 163, 25)
$cButton10 = GUICtrlCreateButton("获取系统序列号", 8, 112, 163, 25)
$cButton11 = GUICtrlCreateButton("开启默认公享", 191, 112, 163, 25)
$cButton12 = GUICtrlCreateButton("HD声卡调麦补丁", 374, 112, 163, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$cGroup2 = GUICtrlCreateGroup("Radmin", 1, 160, 261, 161)
$cLabel1 = GUICtrlCreateLabel("IP:", 40, 184, 26, 17)
$cLabel2 = GUICtrlCreateLabel("端口:", 40, 216, 40, 17)
$cLabel3 = GUICtrlCreateLabel("动作:", 40, 248, 40, 17)
$cButton13 = GUICtrlCreateButton("登录", 24, 280, 75, 25)
$cButton14 = GUICtrlCreateButton("Radmin", 160, 280, 75, 25)
GUICtrlCreateInput("", 80, 176, 161, 21)
GUICtrlCreateInput("4899", 80, 208, 161, 21)
$cCombo1 = GUICtrlCreateCombo("控制", 80, 240, 161, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "监视|传文件|Telnet")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$cGroup3 = GUICtrlCreateGroup("WinBox", 284, 160, 261, 161)
$cButton15 = GUICtrlCreateButton("登录", 304, 280, 75, 25)
$cButton16 = GUICtrlCreateButton("WinBox", 448, 280, 75, 25)
$cInput3 = GUICtrlCreateInput("", 363, 176, 161, 21)
$cInput4 = GUICtrlCreateInput("", 363, 208, 161, 21)
$cInput5 = GUICtrlCreateInput("", 363, 240, 161, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$cLabel4 = GUICtrlCreateLabel("IP:", 323, 184, 26, 17)
$cLabel5 = GUICtrlCreateLabel("用户:", 323, 216, 40, 17)
$cLabel6 = GUICtrlCreateLabel("密码", 323, 248, 28, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$cGroup4 = GUICtrlCreateGroup("分辨率设置", 0, 328, 545, 41)
$cButton17 = GUICtrlCreateButton("更改", 456, 340, 75, 25)
$cLabel7 = GUICtrlCreateLabel("宽", 16, 346, 16, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$cLabel8 = GUICtrlCreateLabel("高", 112, 346, 16, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$cLabel9 = GUICtrlCreateLabel("刷新率", 208, 346, 40, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$cLabel10 = GUICtrlCreateLabel("颜色", 328, 346, 28, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$cCombo2 = GUICtrlCreateCombo("1024", 40, 344, 60, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "1280|1440")
$cCombo3 = GUICtrlCreateCombo("768", 136, 344, 60, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "1024|900")
$cCombo4 = GUICtrlCreateCombo("60", 256, 344, 60, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "70|72|75|85")
$cCombo5 = GUICtrlCreateCombo("16", 368, 344, 60, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "32")
;启动项管理
$Form4 = GUICreate("启动项管理", 547, 372, 15, 60,$WS_CHILD,"",$Form1)
$dGroup1 = GUICtrlCreateGroup("删除启动项", 0, 0, 545, 292)
$dListView1 = GUICtrlCreateListView("名称|路径|位置", 8, 16, 529, 230, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_SUBITEMIMAGES,$LVS_EX_FULLROWSELECT))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 129)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 200)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 200)
_GUICtrlListView_JustifyColumn(GUICtrlGetHandle($dListView1), 1, 2)
_GUICtrlListView_JustifyColumn(GUICtrlGetHandle($dListView1), 2, 2)
$var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 1)
$path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$var)
$dListView1_0 = GUICtrlCreateListViewItem($var&"|"&$path&"|"&"HKEY_LOCAL_MACHINE", $dListView1)
GUICtrlSetImage(-1,$path,1)
$var1 = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 2)
$path1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run",$var1)
$dListView1_1 = GUICtrlCreateListViewItem($var1&"|"&$path1&"|"&"HKEY_LOCAL_MACHINE", $dListView1)
GUICtrlSetImage(-1,$path1,1)
$dListView1_2 = GUICtrlCreateListViewItem("|33|333", $dListView1)
$dButton1 = GUICtrlCreateButton("删除该项", 280, 256, 115, 25)
$dButton2 = GUICtrlCreateButton("刷新列表", 416, 256, 115, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$dGroup2 = GUICtrlCreateGroup("添加启动项", 0, 296, 545, 73)
$dCombo1 = GUICtrlCreateCombo("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", 8, 312, 529, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
$dInput1 = GUICtrlCreateInput("启动名称", 8, 340, 121, 21)
$dInput2 = GUICtrlCreateInput("启动路径", 144, 340, 177, 21)
$dButton3 = GUICtrlCreateButton("浏览", 344, 340, 59, 21)
$dButton4 = GUICtrlCreateButton("确认添加", 432, 340, 99, 21)
;进程管理
$Form5 = GUICreate("进程管理", 547, 372, 15, 60,$WS_CHILD,"",$Form1)
$eGroup1 = GUICtrlCreateGroup("进程管理", 0, 0, 545, 368)
$eListView1 = GUICtrlCreateListView("进程名称|PID值|程序路径", 8, 16, 529, 294, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_SUBITEMIMAGES,$LVS_EX_FULLROWSELECT))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 120)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 320)
_GUICtrlListView_JustifyColumn(GUICtrlGetHandle($eListView1), 1, 2)
Create()
$eButton1 = GUICtrlCreateButton("刷新列表", 136, 326, 90, 25)
$eButton2 = GUICtrlCreateButton("结束进程", 264, 326, 90, 25)
$eButton3 = GUICtrlCreateButton("打开进程目录", 392, 326, 120, 25)
$eLabel1 = GUICtrlCreateLabel("进程数:", 8, 330, 43, 17)
$eLabel2 = GUICtrlCreateLabel("", 56, 330, 43, 17)
;控件面板
$Form6 = GUICreate("Form1", 547, 372, 15, 60,$WS_CHILD,"",$Form1)
$fGroup1 = GUICtrlCreateGroup("控件面板", 0, 0, 545, 368)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Local $Current = ""
GUISetState(@SW_SHOW,$Form1)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit(Quit())
Case $Button1
If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
GUISetState(@SW_SHOW, $Form2)
$Current = $Form2
Case $Button2
If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
GUISetState(@SW_SHOW, $Form3)
$Current = $Form3
Case $Button3
If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
GUISetState(@SW_SHOW, $Form4)
$Current = $Form4
Case $Button4
If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
GUISetState(@SW_SHOW, $Form5)
$Current = $Form5
_GUICtrlListView_BeginUpdate($eListView1)
_GUICtrlListView_DeleteAllItems($eListView1)
Create()
_GUICtrlListView_EndUpdate($eListView1)
$eLabel2 = GUICtrlCreateLabel(ProcessNum(), 56, 330, 43, 17)
GUICtrlSetFont(-1, 10, 400, 0, "宋体")
Case $eButton1
_GUICtrlListView_BeginUpdate($eListView1)
_GUICtrlListView_DeleteAllItems($eListView1)
Create()
_GUICtrlListView_EndUpdate($eListView1)
$eLabel2 = GUICtrlCreateLabel(ProcessNum(), 56, 330, 43, 17)
GUICtrlSetFont(-1, 10, 400, 0, "宋体")
Case $eButton2
$HWnd = GUICtrlRead($eListView1)
$Text = GUICtrlRead($HWnd)
$Split = StringSplit($Text,"|")
If $HWnd = 0 Then ;判断是否选中了LISTVIEW
MsgBox(16,"提示","请选择要结束的进程")
ElseIf $HWnd <> 0 Then ;123-137选中进程并且通过PID进行结束进程以及刷新进程列表
ProcessClose($Split[2])
Sleep(300)
_GUICtrlListView_BeginUpdate($eListView1)
_GUICtrlListView_DeleteAllItems($eListView1)
Create()
_GUICtrlListView_EndUpdate($eListView1)
$eLabel2 = GUICtrlCreateLabel(ProcessNum(), 56, 330, 43, 17)
GUICtrlSetFont(-1, 10, 400, 0, "宋体")
EndIf
Case $eButton3
$HWnd = GUICtrlRead($eListView1)
$Text = GUICtrlRead($HWnd)
$Split = StringSplit($Text,"|")
If $HWnd = 0 Then
MsgBox(16,"提示","请选择您要打开目录的进程!")
ElseIf $HWnd <> 0 Then
$ProStrNum = StringLen($Split[1])
$ProPath = StringTrimRight($Split[3],$ProStrNum)
If $ProPath = "" Then
MsgBox(16,"提示","您选择的进程目录无效或者路径为空,无法打开!")
ElseIf $ProPath <> "" Then
ShellExecute($ProPath)
EndIf
EndIf
Case $Button5
If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
GUISetState(@SW_SHOW, $Form6)
$Current = $Form6
$control = ObjCreate("Shell.Explorer.2")
$Obj = GUICtrlCreateObj($control, 0, 0, 545, 368)
$control.navigate("file:///::%7B20D04FE0-3AEA-1069-A2D8-08002B30309D%7D%5C::%7B21EC2020-3AEA-1069-A2DD-08002B30309D%7D")
EndSwitch
WEnd
;定义创建进程列表函数
Func Create()
$ProcessList = ProcessList()
For $i = 1 To $ProcessList[0][0]
$ProcessPath = _WinAPI_GetModuleFileNameEx($ProcessList[$i][1])
$ProcessPID = $ProcessList[$i][1]
If $ProcessPID = 0 Or $ProcessPID = 4 Then
$ProcessPath = ""
EndIf
GUICtrlCreateListViewItem($ProcessList[$i][0]&"|"&$ProcessPID&"|"&$ProcessPath, $eListView1)
;检查程序是否存在图标,如果没有,则用系统默认的图标
$x = GUICtrlSetImage(-1,_WinAPI_GetModuleFileNameEx($ProcessList[$i][1]),1)
If $x = 0 Then
GUICtrlSetImage(-1,"shell32.dll",3)
EndIf
Next
EndFunc
Func ProcessNum()
$List = ProcessList()
$Num = $List[0][0]
Return($Num)
EndFunc
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
$Dll = DllOpen($SkincrafterDll)
DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
DllCall($Dll, "int:cdecl", "ApplySkin")
EndFunc
Func Quit()
GUISetState(@SW_HIDE)
DllCall($dll, "int:cdecl", "DeInitDecoration")
DllCall($dll, "int:cdecl", "RemoveSkin")
DllClose($dll)
FileDelete(@TempDir&"\vista_style.skf")
FileDelete(@TempDir&"\SkinCrafterDll_31.dll")
Exit
EndFunc
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|