找回密码
 加入
搜索
查看: 1193|回复: 1

关于判断进程的路径问题!

[复制链接]
发表于 2009-1-2 03:13:51 | 显示全部楼层 |阅读模式
MsgBox(64,"进程信息","进程路径是:"&Processpath(616))
Func Processpath($iPID)
    Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
    If $aProc[0] = 0 Then Return SetError(1, 0, '')
    Local $vStruct = DllStructCreate('int[1024]')
    DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
    Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048)
    If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '')
    Return $aReturn[3]
EndFunc
上面的代码是判断指定进程的路径的,但是进程是哪个参数指定的?是$iPID还是哪个?请教高手。。怎么定义?

[ 本帖最后由 半芯蕃茄 于 2009-1-11 01:05 编辑 ]
发表于 2009-1-2 11:35:04 | 显示全部楼层
$IPID是进程的PID值 你得先获取进程的PID才行
获取PID的方法有很多 请在帮助自行搜索
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 03:25 , Processed in 0.071352 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表