在做项目的二次开发中需要用到使用PB查找应用程序名称返回的PID, 主要参考两个论坛的帖子地址如下,因为一个是VB环境下的,各种变量类型与PB不同,需要进行转换,经过多次测试,整了一个整天终于搞定了,现把源码分享出来,以备后用。
主要有三个函数 f_getpid, f_getpidusr , f_getuser
函数中需要引用的结构体
global type s_process from structure
unsignedlong structsize
unsignedlong usage
unsignedlong processid
unsignedlong defaultheapid
unsignedlong moduleid
unsignedlong threads
unsignedlong parentprocessid
unsignedlong classbase
unsignedlong flags
character filename[256]
end type
global type sid_and_attributes from structure
unsignedlong SID
unsignedlong Attributes
end type