Search the web
Sign In
New User? Sign Up
perlguitest · Win32::GuiTest (Perl)
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Radio button problem   Message List  
Reply | Forward Message #1806 of 1815 |
Hi,
I have one MFC application which has 2 radio buttons.

O Chick Here O Click there


by default "Click there" will be selectted....But i want only "Click
here" to be checked....but interestingly "both" the radio buttons
will be checked...

I want only that "Click here" to be selected....How can i achieve
this??...

My code is here

[code]

#!/usr/bin/perl -w
use strict;
use Win32;
use Win32::Process;
use Win32::GuiTest qw(:ALL);

# path to where the perl interpreter resides
my $perl = 'c:\Perl\bin\perl.exe';
my $i;
# path to the tested program (current directory)
my $program = 'hope.pl';
my $text;
my @button;
# tested program handler as "returned" by Process::Create
my $process_object;

# list of windows; we use this to keep all found windows
# returned by FindWindowLike()
my @windows;
my @hnds;


Win32::Process::Create( $process_object, "C:\\Program Files\\HP
StorageWorks Library and Tape Tools\\TT.exe", "",0,
NORMAL_PRIORITY_CLASS, ".", )
|| die "Could not spawn process";
sleep 3;
@windows = FindWindowLike( undef, "TT - Startup", "" );
print $windows[0];
$text=GetWindowText($windows[0]);
print "\n".$text;


@button=FindWindowLike($windows[0],"","Button");
click_on_the_middle_of_window($windows[0]);
sleep 2;
foreach $i(@button)
{
$text=GetWindowText($i);
if($text eq "Click here")
{ CheckButton($i);}

}



sub click_on_the_middle_of_window {

# the window handle of the window we will click on
my $window = shift;

print
"* Moving the mouse over the window id: $window\n";

# get the coordinates of the window
my ( $left, $top, $right, $bottom ) =
GetWindowRect($window);

# now we move the mouse right in the middle of the
# window
MouseMoveAbsPix( ( $right + $left ) / 2,
( $top + $bottom ) / 2 );

# ;-)
sleep(1);

# send LEFT CLICK event
print "* Left Clicking on the window id: $window\n";
SendMouse("{LeftClick}");
sleep(1);
}


[/code]




Wed Aug 1, 2007 10:59 am

rag84dec
Offline Offline
Send Email Send Email

Forward
Message #1806 of 1815 |
Expand Messages Author Sort by Date

Hi, I have one MFC application which has 2 radio buttons. O Chick Here O Click there by default "Click there" will be selectted....But i want only...
rag84dec
Offline Send Email
Aug 1, 2007
11:03 am

Hi Is it possible to access a Window in another machine? for example, i have a perl script on one machine which is a webserver. The script is on the webpage....
animesh bhowmick
animeshb
Offline Send Email
Aug 1, 2007
2:02 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help