Discussion:
How to run external program but keep window in background?
(too old to reply)
stoeckel
2006-10-29 19:10:06 UTC
Permalink
Hi folks,
 
I couldn't find a hint to the following problem.
 
I start an external program from LabVIEW via a batch file which is executed with the "system exec.vi". The option "run minimized" is chosen. However, the window of the external program stays in the foreground nevertheless. How can I keep the panel of the calling vi in the foreground?
 
My question is very similar to
 
<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=94926&amp;query.id=178052#M94926" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=94926&amp;query.id=178052#M94926</a>
&nbsp;
but that question was not sufficiently answered by anybody.
&nbsp;
Thanks in advance,
Peter
altenbach
2006-10-29 20:10:05 UTC
Permalink
The "run minimized" option applies to the command window, it has no effect on the program called from within the command window.
&nbsp;
The solution is to use the "start" command with option /MIN.
&nbsp;
For example, to start notepad minimized, you would use the command "start /MIN notepad.exe". So feed this command to the "system exec". See if it works!
&nbsp;
altenbach
2006-10-29 20:40:07 UTC
Permalink
For more details, have a look at the microsoft article:
&nbsp;
<a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true" target="_blank">http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true</a>
&nbsp;
(It is a bit misleading, because the description for /min and /max seem wrong, they only describe the behavior if start is used without parameters. The correct description should be:

/min&nbsp;: Starts an application minimized.&nbsp; /max&nbsp;: Starts an application maximized.
In any case, if you run a more sophisticated application, it might have its own fancy commandline parameters, some of them might specify minimized, minimized to tray, or hidden, etc. In this case you could used those instead. Check the documentation
stoeckel
2006-10-30 17:10:08 UTC
Permalink
This post might be inappropriate. Click to display it.
eruvi
2008-08-07 06:40:07 UTC
Permalink
This post might be inappropriate. Click to display it.
mathan
2008-08-07 06:40:07 UTC
Permalink
<a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=244790&amp;query.id=71390#M244790" target="_blank">search</a>
eruvi
2008-08-07 06:40:07 UTC
Permalink
The OPUS in page you have sent me is other OPUS software.

Loading...