in reply to Re: minimizing a window on computer startup
in thread minimizing a window on computer startup

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);

Replies are listed 'Best First'.
Re^3: minimizing a window on computer startup
by Seshouan (Acolyte) on Sep 29, 2004 at 16:47 UTC
    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.
      Hi, I investigated some more and found that Win32::AdminMisc::CreateProcessAsUser can start a GUI-program in minimized state:

      use Win32::AdminMisc ; my $prog = q(c:\\windows\\notepad.exe); my $pid = Win32::AdminMisc::CreateProcessAsUser( $prog, Flags => DETAC +HED_PROCESS, Show => SW_MI +NIMIZE ); if ($pid) {print "Success starting $prog, new pid is $pid";} else { print "Failure starting $prog";}
      The "Show"-parameter can take different settings, for instance:
      SW_MAXIMIZE - Show app maximized
      SW_HIDE - Show app hidden (appears in task manager only)
      SW_SHOWNORMAL - Show window in normal state

      Check out the documentation for the full list.

      A .ppd package for Win32::AdminMisc can be downloaded here

      Regards,
      ldln