Forum Discussion

bistritapcv's avatar
bistritapcv
Contributor
6 years ago

Connecting to a pid rather than to a process

Previously I was using TC 12 and C#        Connect.Sys["Process"]("java", 900000);      rootNode = driver.WaitProcess("java");   to connect to my Java process I start up.  But lately there h...
  • BenoitB's avatar
    5 years ago

    I'm not sure to understand the need but perhaps this do your job ?

     

    function GetMyPID(ProcessName, ProcessId) {
      var p = Sys.FindChild("ProcessName", ProcessName);
      var result = -1;
      while (p.Exists) {
        if (p.Id == ProcessId) {
          result = p.Id;
          break;
        } 
    p = Sys.FindChild("ProcessName", ProcessName); } return result; }