in reply to Console Window Minimized
# Listing 3. Code to Hide a Perl Console Window use Win32::API::Prototype; ApiLink( 'kernel32.dll', 'HWND GetConsoleWindow()' ) || die; ApiLink( 'user32.dll', 'BOOL ShowWindow( HWND hWnd, int iCommand )' ) || die; $hWnd = GetConsoleWindow(); print "About to hide the window...\n"; sleep( 1 ); # Hide the window. # BEGIN CALLOUT A ShowWindow( $hWnd, 0x00 ); # END CALLOUT A my @results=`ipconfig \all`; print @results; sleep( 5 ); print "About to restore the window...\n"; # Restore the window. # BEGIN CALLOUT B ShowWindow( $hWnd, 0x04 ); # END CALLOUT B print "Restored!\n";
May be it will be useful.
This code comes from Dave Roth's article Progressive Perl for Windows: Hiding the DOS Box and Other Magical Tricks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Console Window Minimized
by slloyd (Hermit) on Sep 20, 2004 at 16:14 UTC | |
by ccn (Vicar) on Sep 20, 2004 at 17:25 UTC | |
by slloyd (Hermit) on Sep 20, 2004 at 17:28 UTC | |
by BrowserUk (Patriarch) on Sep 20, 2004 at 17:31 UTC | |
by ccn (Vicar) on Sep 21, 2004 at 09:35 UTC | |
by slloyd (Hermit) on Sep 21, 2004 at 01:07 UTC | |
by BrowserUk (Patriarch) on Sep 21, 2004 at 01:36 UTC | |
by slloyd (Hermit) on Sep 21, 2004 at 03:55 UTC |