
-----------------------------------
skootles
Wed Mar 01, 2006 9:02 pm

Check if a process is running
-----------------------------------
I was wondering if it's possible in turing to check if a process is running. Say, for example, I have MSN running. The process name is "MsnMsgr.exe" in the task manager. Is there any way in turing to detect if a process is running?

-----------------------------------
Andy
Wed Mar 01, 2006 9:55 pm


-----------------------------------
no it cant, turing doesn have access to system resources

-----------------------------------
jamonathin
Wed Mar 01, 2006 11:17 pm


-----------------------------------
You can always cheat, like this:

if Sys.Exec ("C:\\Windows\\system32\\taskmgr.exe") then
end if

Just like I can run a calculator program in 2 lines:

if Sys.Exec ("C:\\Windows\\system32\\calc.exe") then
end if


:lol:

-----------------------------------
MysticVegeta
Thu Mar 02, 2006 2:40 pm


-----------------------------------
err, actually you can run calc in 1 line, Start -> run -> cmd -> calc.exe. But thats not the point.. lol. He wants to know how to "check" if soemthing is running and that cannot be done unless you run the program your self which I donnt think he wants tod o.

-----------------------------------
md
Thu Mar 02, 2006 6:38 pm


-----------------------------------
Surely there must be a way to add libraries to turing; ones that use functions written in a different language? I know that windows provides system calls for process management that would do what you want, but I doubt that the native windows APIs have been interfaced to turing.

-----------------------------------
Cervantes
Thu Mar 02, 2006 8:00 pm


-----------------------------------
There is.  You can bring the function in with the external keyword.  This is how most of Turing's built-in functions/procedures work.  

However, where that C++ (or others?) function is located is the important question.

-----------------------------------
[Gandalf]
Thu Mar 02, 2006 8:43 pm


-----------------------------------
Really?  How would you go about that?

The functions that are called using external, I believe, are located in the turing.pdb file and/or hardcoded in the executable file.  If there is a way to somehow add a function from another language, I would be very interested to know how.
