in reply to minimizing a window on computer startup

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".

  • Comment on Re: minimizing a window on computer startup

Replies are listed 'Best First'.
Re^2: minimizing a window on computer startup
by ldln (Pilgrim) on Sep 29, 2004 at 05:19 UTC
    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.
        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