Loading ...
Sorry, an error occurred while loading the content.
 

Radio button problem

Expand Messages
  • rag84dec
    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
    Message 1 of 2 , Aug 1, 2007
      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]
    • animesh bhowmick
      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.
      Message 2 of 2 , Aug 1, 2007
        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. But it
        should execute from another machine.

        machine 1: IP address 12.11.112.12 (1.pl is put on the
        apache server and published on webpage. It uses
        several GUI windows for its execution

        machine 2: Ip address 12.11.22.112 Since the machine 1
        is a apache server, i am able to run the script from
        here. But since the function uses FindWindowLike which
        is localized. this does not work.

        Is it possible to write the script with IP address
        embedded in it to be able to identify as to where the
        script should finally run?

        Looking forward to some ideas.

        Regards
        Animesh





        ____________________________________________________________________________________
        Sick sense of humor? Visit Yahoo! TV's
        Comedy with an Edge to see what's on, when.
        http://tv.yahoo.com/collections/222
      Your message has been successfully submitted and would be delivered to recipients shortly.