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
|