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";
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |