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

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.
  • Comment on Re^3: minimizing a window on computer startup

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