关于我们┊AboutMe

昵称:Hopol(■童■)

联系:QQ:18883

邮箱:info(at)18883.com

主页:www.18883.com

手机浏览 日志归档 RSS 2.0 订阅
Register | Login

AU3---简单任务管理器

#include <GUIConstants.au3>
#notrayicon
dim $ListView1
GUICreate("简单的进程管理器", 257, 364)
$Button1 = GUICtrlCreateButton("结束进程", 8, 328, 105, 25)
$Button2 = GUICtrlCreateButton("刷新列表", 144, 328, 105, 25)
$ListView1 = list()
GUISetState(@SW_SHOW)
While 1
 $msg = GuiGetMsg()
 Select
 Case $msg = $GUI_EVENT_CLOSE
  ExitLoop
 Case $msg = $Button1
  proclose()
 Case $msg = $Button2
  $ListView1 = list()
 EndSelect
WEnd
Exit

func list()
 if $ListView1 then GUICtrlDelete($ListView1)
 $list = ProcessList()
 $ListView1 = GUICtrlCreateListView("进程名                              |PID      ", 8, 8, 241, 305)
 for $i = 1 to $list[0][0]
  GUICtrlCreateListViewItem($list[$i][0]&"|"&$list[$i][1],$listview1)
 next
 return $ListView1
endfunc

func proclose()
 $pro = stringsplit(GUICtrlRead(GUICtrlRead($listview1)),"|")
 if $pro[0] = 2 then
  if ProcessExists($pro[2]) then ProcessClose($pro[2])  ;;runwait(@ComSpec & " /c taskkill /f /t /pid " & $pro[2],"",@sw_hide)
  else
   msgbox(4096,"错误","无法终止进程!")
  EndIf
  sleep(1000)
  if $pro[0] = 2 then
  if ProcessExists($pro[2]) then 
  msgbox(4096,"错误","无法终止进程!")
  return
 endif
 endif
 $ListView1 = list()
endfunc

Tags: au3, 任务管理器, 源码

« 上一篇 | 下一篇 »

只显示10条记录相关文章

dede5.1 UTF8商业版 (浏览: 119, 评论: 1)
dede5.1 BGK商业版 (浏览: 124, 评论: 0)
PHP在图片上写上中文[备份] (浏览: 131, 评论: 0)
AU3热血江湖群医辅助工具 (浏览: 604, 评论: 0)
MyBc_V4.6 完整源码 (浏览: 570, 评论: 0)
D版CGO修复程序 源码 (浏览: 561, 评论: 0)
锐起绿色连接器完全后台版 au3源码 (浏览: 592, 评论: 0)
劲舞团3.1启动器代码 au3源码 (浏览: 594, 评论: 0)
YG2007播放器的安装源码 (浏览: 548, 评论: 0)
AU3-调用user32.dll来做随即启动GUI界面 (浏览: 553, 评论: 0)

发表评论