buzzthebuzzsaw has asked for the wisdom of the Perl Monks concerning the following question:
Just a quick question, (at least I think that it's quick!).
I've seen on some sites that it's possible to hide the dos window using the Win32::API::Prototype module.
I've installed it but the function "GetConsoleWindow()" seems to be missing.
Does anyone know what I've done wrong, or is there something else I should be using.
Below is the code that supposed to hide the dos console...
If anyone has any idea why this is going screwy or another way to hide the dos console window, I'd be extremely greatful.
Thanks,
Buzzthebuzzsaw.
use Win32::API::Prototype; ApiLink( 'KERNEL32.DLL', 'HWND GetConsoleWindow()' ); ApiLink( 'USER32.DLL', 'BOOL ShowWindow( HWND hWnd, int iCommand )' ); $hWnd = GetConsoleWindow(); print "About to hide the window...\n"; sleep( 1 ); # Hide the window. # BEGIN CALLOUT A ShowWindow( $hWnd, 0x00 ); # END CALLOUT A print "Now let's count to 100:\n"; foreach my $Count ( 1..100 ) { print "$Count, "; } print "\n"; sleep( 5 ); print "About to restore the window...\n"; # Restore the window. # BEGIN CALLOUT B ShowWindow( $hWnd, 0x04 ); # END CALLOUT B print "Restored!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hiding the dos console where perl program was called from in windows?
by Mr. Muskrat (Canon) on Nov 13, 2002 at 23:21 UTC | |
by buzzthebuzzsaw (Acolyte) on Nov 13, 2002 at 23:38 UTC | |
|
Re: Hiding the dos console where perl program was called from in windows?
by vek (Prior) on Nov 13, 2002 at 23:19 UTC | |
|
Re: Hiding the dos console where perl program was called from in windows?
by Anonymous Monk on Nov 13, 2002 at 23:53 UTC | |
by buzzthebuzzsaw (Acolyte) on Nov 15, 2002 at 22:01 UTC |