首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

如何列举系统进程

2012-01-08 
怎么列举系统进程?怎么列举系统进程?[解决办法]http://topic.csdn.net/t/20051108/10/4378494.html[解决办

怎么列举系统进程?
怎么列举系统进程?

[解决办法]
http://topic.csdn.net/t/20051108/10/4378494.html
[解决办法]
Private Sub Command3_Click()
Dim strComputer As String
Dim objWMIService As Object
Dim colProcessList
Dim objProcess As Object
On Error Resume Next
strComputer = ". "
Set objWMIService = GetObject( "winmgmts: " & "{impersonationLevel=impersonate}!\\ " & strComputer & "\root\cimv2 ")
Set colProcessList = objWMIService.ExecQuery( "select * from win32_process ") 'where processid=1764
Debug.Print "=================================== "
For Each objProcess In colProcessList
'objProcess.SetPriority (256)
'If objProcess.GetOwner = "SYSTEM " Then
RET = objProcess.GetOwner(USERNAME)
If USERNAME = "SYSTEM " Then Debug.Print CStr(objProcess.Name), CStr(objProcess.processid), USERNAME
'Debug.Print objProcess.Name, objProcess.commandline
Next
End Sub

热点排行