Hide the console window... It was a question I had asked recently.
my ($DOS) = Win32::GUI::GetPerlWindow(); Win32::GUI::Hide($DOS); -- Scott Carr OpenOffice.org Documentation Maintainer http://documentation.openoffice.org/ Quoting Beckett Richard-qswi266 <[EMAIL PROTECTED]>: > Hi folks, > > I have been trawling Google looking for a solution, and I thought I'd found > it, but for the life of me I can't get it to work, yet it seems a common > answer to the question... > > When I start my script, I use the original dos window as a console window, > and create a GUI using Tk. > > I want to disable the X in the corner of the console window, so that the > user has to exit the program correctly from the GUI. > > Here's what I have... > =-=-=- > # DEFINE THE REQUIRED MODULES > use strict; > use warnings; > use Win32::GUI; > > # Open the console window after it minimises (can't stop minimise) > # Do it now, because there's a long pause on slower machines otherwise. > my $perlwin = Win32::GUI::GetPerlWindow(); > Win32::GUI::OpenIcon($perlwin); > Win32::GUI::Move($perlwin, 0, 0); > print "Loading, please wait for the GUI window...\n"; > > # Define rest of modules. > use Net::FTP; > use Net::Cmd; > use Time::HiRes qw( usleep gettimeofday tv_interval ); > use Win32::OLE qw(in with); > use Win32::OLE::Const 'Microsoft Excel'; > use Win32::OLE::Variant; > use Win32::OLE::NLS qw(:LOCALE :DATE); > $Win32::OLE::Warn = 0; # I'll handle errors myself! > use Cwd; > use Win32::Console; > use Tk; > use Tk::Menu; > use Tk::Widget; > use TK::DialogBox; > use Tk::ErrorDialog; > > $perlwin = Win32::GUI::GetPerlWindow(); > $perlwin->protocol('WM_DELETE_WINDOW' => sub{}); > > When this runs, I get the follwing error: > > Loading, please wait for the GUI window... > Can't call method "protocol" without a package or object reference at > multi-ftp-v31.pl line 39. > > I really don't know what I'm doing wrong, and it's driving me knuts! > > Thanks. > > R. > _______________________________________________ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/