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

Re: How to know button is enabled or disabled?

Expand Messages
  • santoshkadli
    Hi, I assume $BName is defined or have a specific value being assigned before comparing. So check by editing following, 1) if ($buttonName eq $BName) 2) $res =
    Message 1 of 3 , Jan 14, 2006
      Hi,
      I assume $BName is defined or have a specific value being assigned
      before comparing. So check by editing following,
      1) if ($buttonName eq $BName)
      2) $res = IsWindowEnabled($buttonName); --> Once TRUE
      3) Instead of,
      MouseMoveAbsPix($x+150,$y+305);#Options
      >SendMouse("{LEFTCLICK}");

      try, PushChildButton( $ParentWindowHandle, "$ButtonName", 0.25 );

      ~Santosh



      --- In perlguitest@yahoogroups.com, "ashastry06" <aparnashastry@h...>
      wrote:
      >
      > Hi,
      > I want to click the button only, if the button is enabled. if not
      > do something else. Please tell what am I doing wrong? Attaching part
      > of my code.
      >
      >
      > my @childern = GetChildWindows($_);
      > for (@childern) {
      > $buttonName = WMGetText($_);
      > print $buttonName,"\n";
      > $className = GetClassName($_);
      > # $BName == ("^\&Options" );
      >
      > if ($buttonName == $BName ) {
      > $res = IsWindowEnabled($BName) ;
      > if($res == 'TRUE'){
      > MouseMoveAbsPix($x+150,$y+305);#Options
      > SendMouse("{LEFTCLICK}");
      > print "in while loop","\n";
      > }
      > print "out of while loop","\n";
      > }
      > else {
      > print "whoops","\n";
      > }
      >
      > }
      >
      >
      > Thanks,
      > Aparna
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.