07-20-2010 11:13 PM
Hi all
I am new to program in Labview. Now I am working on a program to terminate a windows application using LabView. I tried calling the win32 API function such as TerminateProcess(), but this command requires structures predefined in other header files. However, I do not know how to import other files through the Call Library Function Node.
Will someone be willing to give me some suggestions?
Thanks a lot!
Solved! Go to Solution.
07-21-2010 07:33 PM
Hey Lxm,
After looking at you post and trying with the win32 dll, I found it was much easier to use .NET to get the job done. I was able to create an example using the System.Diagnostics.Process constructor. From here I polled the available processes using the GetProcesses method. Now that I had all the references to the processes that were running, I converted the references to their actual names by using the ProcessName property. With this information, you can search for the array for the process you are looking for (I search for firefox) and then killed the process (Kill was the method.)
I have included a snippet of the code below. I have also posted this code as an example on our website.
07-21-2010 08:20 PM - edited 07-21-2010 08:21 PM
Hi Jim,
Thanks a lot for your answer. It is very helpful.
BTW, I found an easier solution for this problem as well: Using the windows built-in command taskkill.exe /IM .
Thanks again.