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

Re: Setting the focus for a combo entry for input via SendKeys()?

Expand Messages
  • santoshkadli
    I could do this by calling the PushChildButton($WindowID, $ControlID ). $ControlID = Control ID is the decimal control ID of that perticular Combo object. YOu
    Message 1 of 5 , Jan 10, 2006
    • 0 Attachment
      I could do this by calling the
      PushChildButton($WindowID, $ControlID ).
      $ControlID = Control ID is the decimal control ID of that perticular
      Combo object. YOu can get it from the WinSpy.
      ~Santosh


      --- In perlguitest@yahoogroups.com, "brentje" <brentje@y...> wrote:
      >
      > I'm not sure if there is a command for it, but I've taken to doing
      > many things strictly with mouse clicks. You can do the same if
      you've
      > already got the HWND of the combo you want to set focus to. Just
      find
      > out it's Rect values, do some math to find the middle of the combo,
      > and then click on that area. That should set focus to the combo if
      > it's enabled. This is part of the code I wrote for selecting a
      value
      > in a combobox:
      >
      > ($lx, $ty, $rx, $by) = GetWindowRect( $hwnd );
      >
      > $x = $lx + (($rx - $lx)/2);
      > $y = $ty + (($by - $ty)/2);
      >
      > MouseMoveAbsPix($x,$y);
      > SendMouse('{LEFTCLICK}');
      >
      > A single click will dropdown the box, so you might want to do a
      double
      > click to set it back again.
      >
      > --- In perlguitest@yahoogroups.com, "yi020024" <yi020024@y...>
      wrote:
      > >
      > > I have the window Id for a combo entry, but I can not make it
      active
      > > for SendKeys () (or even SelComboString ()). I've tried
      SetFocus ()
      > > and SetActiveWindow () but they do not set the focus to the
      desired
      > > entry.
      > >
      > > Is there a specific GUI command to set this focus to a
      particular combo
      > > (or field) entry?
      > >
      > > geo
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.