标题:如何获取任务管理器中正在运行的程序的名称﹖
只看楼主
appleuser
Rank: 1
等 级:新手上路
帖 子:81
专家分:0
注 册:2007-5-1
 问题点数:0 回复次数:6 
如何获取任务管理器中正在运行的程序的名称﹖
请教各位DX﹕如何获取任务管理器中正在运行的程序的名称﹖
搜索更多相关主题的帖子: 管理器 任务 名称 获取 
2008-02-22 13:01
zfc123
Rank: 2
等 级:论坛游民
帖 子:136
专家分:39
注 册:2007-5-4
得分:0 
你参考一下吧,我也不知道怎么解释,以前找的

      l = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
   
      If l Then
   
          my.dwSize = 1060
   
          If (Process32First(l, my)) Then         '遍历第一个进程
   
              Do
                '     Set mlistitem = ListView1.ListItems.Add(, , my.th32ProcessID)
                '  mlistitem.SubItems(1) = my.th32ParentProcessID
                ' mlistitem.SubItems(2) = my.szExeFile
                i = InStr(1, my.szExeFile, Chr(0))
   
                  mName = LCase(Left(my.szExeFile, i - 1))
                  If aa >= 2 Then
                  'Unload Me
                  End
                  Else
                  If mName = "aip.exe" Then
                  'MsgBox aa
                  aa = aa + 1
                  End If
                  End If
              Loop Until (Process32Next(l, my) < 1)             '遍历所有进程知道返回值为False
    If aa > 1 Then
    Timer1.Enabled = True
    Timer2.Enabled = True
    Exit Sub
    End If
            End If
   
          l1 = CloseHandle(l)
   
      End If
2008-02-27 18:18
appleuser
Rank: 1
等 级:新手上路
帖 子:81
专家分:0
注 册:2007-5-1
得分:0 
謝謝﹐我先試一下﹗

VB刚入门
2008-03-01 13:11
appleuser
Rank: 1
等 级:新手上路
帖 子:81
专家分:0
注 册:2007-5-1
得分:0 
用不了啊﹗

VB刚入门
2008-03-01 13:15
wf271919052
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2008-3-1
得分:0 
[bc01]
2008-03-01 13:47
zfc123
Rank: 2
等 级:论坛游民
帖 子:136
专家分:39
注 册:2007-5-4
得分:0 
Private Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
声明一下变量试试
2008-03-04 20:24
zfc123
Rank: 2
等 级:论坛游民
帖 子:136
专家分:39
注 册:2007-5-4
得分:0 
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Private Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, ByVal uExitCode As Long) As Long

Private Type PROCESSENTRY32
   
          dwSize   As Long
   
          cntUsage   As Long
   
          th32ProcessID   As Long
   
          th32DefaultHeapID   As Long
   
          th32ModuleID   As Long
   
          cntThreads   As Long
   
          th32ParentProcessID   As Long
   
          pcPriClassBase   As Long
   
          dwFlags   As Long
   
          szExeFile   As String * 1024
   
  End Type
在我程序里找的,不知道声明的哪些变量是查找进程的了,你看看
2008-03-04 20:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-200603-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.184118 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved