天软金融分析.NET函数大全 > TSL函数 > 资源访问函数 > 进程相关函数

SysPidOfHandle    

简述
根据进程句柄获取进程ID。在Linux上,返回和进程句柄值相同的整数
定义
SysPidOfHandle(handle:intptr):Integer;
参数
名称类型说明
handleinteger进程句柄
返回值integer获取成功,返回进程ID;否则,返回0
  • 范例

    范例01:根据进程句柄获取进程ID
    //TSL解析器路径
    path := "D:\\Program Files\\AnalyseNG.NET\\TSL.exe";
    //创建管道
    ret:= SysExecNewPipe();
    //创建一个TSL解析器进程
    If ret then
    handle:=SysExec(path,"TSL",nil,0,code);//返回进程句柄
    ret := SysPidOfHandle(handle);
    SysTerminate(rc,handle);//关闭TSL解析器进程
    if ret then
      return ret;
    else
      return "根据进程句柄获取进程ID失败!"

相关