Seshouan has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I've taken a look at notes about Win32:Process, but I can't find anything that would allow me to write a perl script that sends a command to an app to be minimized. I want to run this script upon computer startup, and have it launch and minimize an app that I use in the background. Any suggestions? Thanks. Session
  • Comment on minimizing a window on computer startup

Replies are listed 'Best First'.
Re: minimizing a window on computer startup
by terra incognita (Pilgrim) on Sep 28, 2004 at 16:14 UTC
    See the help on the start syntax. It will be something like "start /MIN my.app"
Re: minimizing a window on computer startup
by ikegami (Patriarch) on Sep 28, 2004 at 15:44 UTC

    Is it started via a shortcut (such as a shortcut in the StartUp group)? If so, edit the properties of that shortcut and change "Run:" to "Minimized".

      If the app is a dos-like program, like cURL or similar (uses a console window that is), you can use the DETACHED_PROCESS flag with the Win32::Process::Create function. Then there will not be created a window for the application as it starts.

      my $result = Win32::Process::Create($process, $path, 'curl.exe', $finherit, DETACHED_PROCESS, $dir);
        my app's not a dos program, it's a software testing tool with a GUI. I would like to start my machine, launch the app automatically, and have it be minimized directly. I'll try this code and see what it gives me. thanks.