From: Peter E. <Pet...@at...> - 2001-02-02 22:00:02
|
I may be wrong, but I've found that you cannot call a _Click() directly (you actually have to Click on something). I'd try this with your subs: sub Open_Click { Open(); } sub Open { my $file=GUI::GetOpenFileName(-title=>"File To Open", -filter=>["*.*"],); } sub OpenHK_Click { Open; } -----Original Message----- From: Erick J. Bourgeois [mailto:er...@e-...] Sent: Thursday, February 01, 2001 12:18 PM To: per...@li... Subject: [perl-win32-gui-users] AcceleratorTable I'm working on an accelerator table and I have written this thus far, but it isn't responding to the keys: use Win32::GUI; $HotKey = new Win32::GUI::AcceleratorTable( "Ctrl-O" => "OpenHK", ); $Menu = Win32::GUI::MakeMenu( "&File" => "File", "> &Open Ctrl+O" => "Open", ); $MainWin = new Win32::GUI::Window( -name => "MainWin", -text => "Accelerator Table", -accel => $HotKey, -size => [200, 200], -pos => [70, 70], -menu => $Menu, ); $MainWin->Show(); Win32::GUI::Dialog(); sub MainWin_Terminate { $MainWin->Hide(); return -1; } sub Open_Click { my $file=GUI::GetOpenFileName(-title=>"File To Open", -filter=>["*.*"],); } sub OpenHK_Click { Open_Click(); } #------------EOF---------------# erick never stop questioning www.jeb.ca <http://www.jeb.ca> |
From: Peter E. <Pet...@at...> - 2001-02-05 16:34:22
|
I've never been able to get the -accel's to work either. Good luck, I am looking forward to seeing the resolution on this. -----Original Message----- From: Erick J. Bourgeois [mailto:er...@e-...] Sent: Saturday, February 03, 2001 10:00 AM To: per...@li... Subject: Re: [perl-win32-gui-users] AcceleratorTable The subs that you supplied do not respond to the keys either. Any more ideas? erick never stop questioning www.jeb.ca <http://www.jeb.ca> ----- Original Message ----- From: Peter Eisengrein <mailto:Pet...@at...> I may be wrong, but I've found that you cannot call a _Click() directly (you actually have to Click on something). I'd try this with your subs: sub Open_Click { Open(); } sub Open { my $file=GUI::GetOpenFileName(-title=>"File To Open", -filter=>["*.*"],); } sub OpenHK_Click { Open; } |
From: Erick J. B. <er...@e-...> - 2001-02-03 16:03:40
|
The subs that you supplied do not respond to the keys either. Any more = ideas? erick never stop questioning www.jeb.ca ----- Original Message -----=20 From: Peter Eisengrein=20 I may be wrong, but I've found that you cannot call a _Click() = directly (you actually have to Click on something). I'd try this with = your subs: sub Open_Click { Open(); } sub Open { my $file=3DGUI::GetOpenFileName(-title=3D>"File To Open", = -filter=3D>["*.*"],); } sub OpenHK_Click { Open; } |
From: christopher s. <chr...@ya...> - 2001-02-03 16:34:36
|
hi all I posted this question before and I didnt even get once response. So Im posting it in a different color. Please tell me if this question is totally off topic here . If it is , can anyone suggest a suitable mailing list for this question I thought since the finest win32 api minds hang out here I would post it = here The code is taken from the actual example --------------------------------------------------------------------- $|=3D1; use Win32::RASE; print "\nI'm dialing via the first RAS entry: $first_RAS_entry\n\n"; ($UserName, $Password) =3D RasGetUserPwd($first_RAS_entry) or die Win32::RASE::FormatMessage; print "UserName:"; !$UserName ? chomp($UserName=3D<>) : print "$UserName\n"; print "Password:"; !$Password ? chomp($Password=3D<>) : print "$Password\n"; $hrasconn =3D RasDial($first_RAS_entry, undef , $UserName, $Password) or die Win32::RASE::FormatMessage; #($err, $status) =3D RasDial("CLICK", "DP 110-6511" , $UserName, = $Password,undef,undef) # or die Win32::RASE::FormatMessage; print "Connected, \$hrasconn=3D$hrasconn\n"; print "\n\n------next line---\n\n"; #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D don't edit under this = line =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D sub FindOpenedFolders () { # returns array of hwnd's of the opened folders my $findAfter =3D 0; my @folders; $FindWindowEx ||=3D new Win32::API("user32", "FindWindowEx", = [N,N,P,P], N); while($findAfter =3D $FindWindowEx->Call(0, $findAfter, = "CabinetWClass", 0)) { push @folders, $findAfter; } $findAfter =3D 0; while($findAfter =3D $FindWindowEx->Call(0, $findAfter, = "ExploreWClass", 0)) { push @folders, $findAfter; } @folders; } sub CloseWindow ($) { # arg - hwnd $PostMessage ||=3D new Win32::API("user32", "PostMessage", [N,N,N,N], = I); $WN_CLOSE =3D 0x10; $PostMessage->Call(shift, $WN_CLOSE, 0, 0); } BEGIN { require Win32::API; unless ($hwnd =3D (FindOpenedFolders())[0]) { system 'start explorer /n,C:\\'; $start_time =3D time; while (!($hwnd =3D (FindOpenedFolders())[0]) && $start_time+3 < = time) {} $hwnd or die "Could not open C:\\ window\n"; $hwnd_opened =3D 1; } $first_RAS_entry =3D (RasEnumEntries())[0] or die "No one RAS entry were found\n"; } END { CloseWindow($hwnd) if $hwnd_opened } =20 The above code when run , starts dialing right away ... but I want sample codes for=20 1) invoking the default original windows DUN dialog . 2) to check whether the user is connected to the internet 3) to disconnet from internet any help will be greatly appreciated or should I use any other perl module ? chris www.perl-resume.com |