vb API使用

来源:百度知道 编辑:UC知道 时间:2024/06/15 09:31:20
1.知道进程名 获取相对进程的标题(句柄) 如TTplay是千千静听 的进程 但是它的标题是滚动的 酷狗也是
2知道标题 获取相对的进程(句柄)
3,知道标题或进程 求 程序 目录
给出相应的函数 有源码最好 ,没有自己折腾。

Attribute VB_Name = "modsysPID"
Option Explicit
'*************************************
'* 没有注释
'* 作者:jpkb@qq.com
'* 开源,转载请保留作者信息。
'* 2008.11.7
'*************************************
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib &qu