=head

  Background: Juniper VPN creates an icon in the Windows XP's tray.
  Clicking on this icon brings up a dialog box titled "Network
  Connect" with buttons labeled ">", "Hide" and "Sign Out".  
  
  Here's some code to get started with accessing this item from a
  perl script and selecting "Sign Out".

  Not the best of scripts, just the beginning of one.
=cut

BEGIN {(*STDERR = *STDOUT) || die;}
use diagnostics;
use warnings;
use strict;

use Win32;
use Win32::GuiTest qw(PushChildButton IsWindowEnabled 
                      IsWindowVisible SetFocus 
                      FindWindowLike GetWindowText 
                      SetForegroundWindow SendKeys 
                      GetChildWindows );

my @wnds = GetChildWindows(0); 

my $foo='';
my $a_wnd;
for (@wnds)
{
   $a_wnd = $_;
   $foo = GetWindowText($a_wnd); 
   $foo =~ m/Network\s+Connect/ and last;
}
SetFocus($a_wnd);
PushChildButton($a_wnd, "Sign Out"); 

__END__
 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to