From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to close the window openned by System Exec VI automatically?

Solved!
Go to solution

Hello,

 

I am using System Exec VI to lauch an exe file built from a LabVIEW program. When running System Exec VI, the window of exe file pop out and stays there even after all tasks are completed. I have to close it every time manually. Anyone here know how to close the exe file window automatically when it's done?

 

Thanks,

Jean

Message Edited by Jean_CLD on 03-25-2010 11:25 AM
Message Edited by Jean_CLD on 03-25-2010 11:29 AM
0 Kudos
Message 1 of 5
(5,185 Views)

Is this the application's GUI window, or is the app a console application? Do you have System Exec's "wait until completion" set to True or False?

 

What operating system are you using? If you're on Windows you can use the Windows API to force-destroy the Window using the FindWindow() function to get the window handle, and then DestroyWindow() to destroy it. Both of these can be called using the Call Library Function Node function. You can download the Windows API Function Utilities for LabVIEW to see how to call these functions.

0 Kudos
Message 2 of 5
(5,163 Views)
Solution
Accepted by Jean_CLD
If I understand the question correctly you need to add an invoke node at the end of your application to exit. Depending on the whether it is running as a stand alone application or within LabVIEW it will either exit or stop execution. I've attached the VI I use in my applications.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 5
(5,147 Views)
Egads, you're right - I completely missed the part where the application was a LabVIEW-built one. Thanks for the correction, Mark.
0 Kudos
Message 4 of 5
(5,136 Views)

q

0 Kudos
Message 5 of 5
(4,382 Views)