liuak 发表于 2008-7-13 14:40:33

创建一个任务管理器界面

今天刚看了解这个语言
觉得很方便
就试着写个任务管理器的界面

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include<GuilistView.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 307, 344, 193, 125)
$Group1 = GUICtrlCreateGroup("进程列表", 8, 8, 289, 313)
$ListView1 = GUICtrlCreateListView("", 16, 24, 273, 289)
; Add columns
_GUICtrlListView_InsertColumn($ListView1, 0, "进程",150)
_GUICtrlListView_InsertColumn($ListView1, 1, "PID",80)

GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Dim $m_list
$list = ProcessList()
for $i = 1 to $list
_GUICtrlListView_AddItem($ListView1,$list[$i],0)
_GUICtrlListView_SetItemText($ListView1, $list - $i, 1, $list[$i])


next


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

                Case $ListView1
        EndSwitch
WEnd


但后面的PID显示不出来
请问我错在哪?

[ 本帖最后由 liuak 于 2008-7-14 11:38 编辑 ]

bing614 发表于 2008-7-13 14:54:52

#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include<GuilistView.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 307, 344, 193, 125)
$Group1 = GUICtrlCreateGroup("进程列表", 8, 8, 289, 313)
$ListView1 = GUICtrlCreateListView("", 16, 24, 273, 289)
; Add columns
_GUICtrlListView_InsertColumn($ListView1, 0, "进程",150)
_GUICtrlListView_InsertColumn($ListView1, 1, "PID",80)

GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Dim $m_list
$list = ProcessList()
for $i = 1 to $list
GUICtrlCreateListViewItem($list[$i] &"|"&$list[$i],$ListView1)
;~ _GUICtrlListView_SetItemText($ListView1, $list - $i, 1, $list[$i])


next


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

                Case $ListView1
        EndSwitch
WEnd

liuak 发表于 2008-7-13 15:04:29

还是运行出错啊
R6002
floating pointsupport not loaded

pcbar 发表于 2008-7-13 20:27:36

for $i = 1 to $list
_GUICtrlListView_AddItem($ListView1,$list[$i],0)
;~ _GUICtrlListView_SetItemText($ListView1, $list - $i, 1, $list[$i])
_GUICtrlListView_AddSubItem($ListView1,$i-1,$list[$i],1)

next

liuak 发表于 2008-7-14 11:37:46

原帖由 pcbar 于 2008-7-13 20:27 发表 http://www.autoitx.com/images/common/back.gif
for $i = 1 to $list
_GUICtrlListView_AddItem($ListView1,$list[$i],0)
;~ _GUICtrlListView_SetItemText($ListView1, $list - $i, 1, $list[$i])
_GUICtrlListView_AddSubItem($ListView1,$ ...
谢谢斑竹
太感谢了

passkalilo 发表于 2009-4-13 17:49:30

不错,学习了......
页: [1]
查看完整版本: 创建一个任务管理器界面