Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

FindWindowByTitle

Is it possible to check what program/applications is now running using openinsight code. I use FindWindowByTitle function, but i think the fucntion is not working.

Any suggestions ?

User: Albert Kurniawan

Comments

  • I'm not sure how familiar you are with accessing the WinAPI from OpenInsight, but the short answer is that you need to use the "Tool Help" functions. CreateToolhelp32Snapshot gets a snapshot of what's running, then you use the handle returned from that to loop through the processes using Process32First and Process32Next.

    However, it gets even more complicated because you then have to use WinAPI structures to get information on each process.

    What problem are you trying solve that requires you to find out what's running?
  • I have OpenInsight form with a button. IF I press the button, it will call funcion:
    x = utility("RUNWIN","C:\Revsoft\Absent.exe").

    But the problem is how to check if the program (Absent.exe)
    is already running or has been closing.

    User: Albert Kurniawan
  • Albert, I apologize for the long delay in writing back to you. I was rather certain I had used FindWindowByTitle before but I am unable to find any examples where I used it. However, I think I have a better solution for you. We have code that will find a running process for you based on the name of the program (e.g., Absent.exe). This is actually an RDK that I can send you that includes several Windows API functions, a structure, and a Basic+ routine (with source code) that will search for the running process. It will require a little work to adapt it for your purposes but I would say it is 95% ready out of the box.
Sign In or Register to comment.