Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Terminate an windows application

Solved!
Go to solution

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!

0 Kudos
Message 1 of 3
(6,491 Views)
Solution
Accepted by topic author lxm1117

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.

 

19589i8E802974874EC01D

 

 


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 2 of 3
(6,473 Views)

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.

 

 

0 Kudos
Message 3 of 3
(6,468 Views)