如此~??
#AutoIt3Wrapper_UseAnsi=y
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <StaticConstants.au3>
GUICreate("进程获取", 640, 480, 193, 125)
$edit = GUICtrlCreateEdit("", 5, 5, 630, 440, $ES_READONLY + $WS_VSCROLL)
$Button1 = GUICtrlCreateButton("ok", 290, 455, 60, 20, 0)
GUISetState(@SW_SHOW)
While 1
$nmsg = GUIGetMsg()
Switch $nmsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
get()
GUICtrlSetData($edit, @CRLF & '获取结束', -1)
EndSwitch
WEnd
Func get()
$foo = Run(@ComSpec & " /c " & 'tasklist', "", @SW_HIDE, $STDOUT_CHILD);如果要远程操作,这里可以使用RunAs函数
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
GUICtrlSetData($edit, $line, -1)
WEnd
EndFunc ;==>get
[ 本帖最后由 298311657 于 2009-3-15 14:15 编辑 ] |