0

I have a Perl script which starts as an ".exe" (along with my main application)

The job of this perlapp is that it queries how long the application has been open (we have floating license and to free up license we close the main application automatically after 120 mins)

During this process the perlapp which runs in the background invokes another application and it's called system

All works as fine except that the called application via system pops up in the foreground. I want to run it as "minimized". Is this possible?

simbabque
  • 53,749
  • 8
  • 73
  • 136
KK99
  • 1,971
  • 7
  • 31
  • 64
  • Related: http://stackoverflow.com/questions/23057448/open-program-minimized-via-command-prompt, http://www.computerhope.com/forum/index.php?topic=63635.0 – simbabque Nov 24 '15 at 10:20

1 Answers1

2

What you need is not Perl-specific, but actually part of your Windows operating system. In order to start any program minimized on Windows, use the following command.

 > start /MIN foo.exe

Now to use this from your Perl program via system is simple.

my $exit_status = system('start /MIN second_application.exe');

Note that this does not work if the program was already running.


Source: tech-recipes.com

simbabque
  • 53,749
  • 8
  • 73
  • 136