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

Working with combos

Expand Messages
  • Steve West-Fisher
    I m having a lot of trouble trying to set the value in a combo. If I just use SendKeys, the value changes as each key is sent, which will not work (I know
    Message 1 of 3 , Feb 12, 2004
    View Source
    • 0 Attachment
      I'm having a lot of trouble trying to set the value in a combo. If I
      just use SendKeys, the value changes as each key is sent, which will
      not work (I know exacly what value I want).

      So I thought I'd try WMSetText. But I need the handle of the combo.
      I cannot get FindWindowLike to work because the control id changes
      each time this window comes up.

      So, any other ideas for getting the handle of the combo? It does
      have focus, but I don't see how to get the handle of the widget with
      focus.
    • Chris Hilton
      I think the short answer would be to use GetFocus in the later versions of GuiTest available from the Yahoo! group files area. I haven t used it myself, so
      Message 2 of 3 , Mar 17, 2004
      View Source
      • 0 Attachment
        I think the short answer would be to use GetFocus in the later versions of
        GuiTest available from the Yahoo! group files area. I haven't used it
        myself, so I'll also offer this other solution, though it's a major hack,
        assumes a static layout, and uses the Win32::ActAcc module.

        Is there a control nearby that you can find so that you can use it as a
        landmark? If so, find that control, get its coordinates, then offset those
        coordinates (you'll have to pre-determine this) to the control you're
        interested in. You should have coordinates to the control you want now. Use
        AccessibleObjectFromPoint in Win32::ActAcc with your coordinates to get an
        AO, then use WindowFromAccessibleObject (also Win32::ActAcc) to get the
        window handle. Easy peasy, right?

        Chris Hilton

        -----Original Message-----
        From: Steve West-Fisher [mailto:steve@...]
        Sent: Thursday, 12 February, 2004 10:59
        To: perlguitest@yahoogroups.com
        Subject: [perlguitest] Working with combos



        So I thought I'd try WMSetText. But I need the handle of the combo.
        I cannot get FindWindowLike to work because the control id changes
        each time this window comes up.

        So, any other ideas for getting the handle of the combo? It does
        have focus, but I don't see how to get the handle of the widget with
        focus.





        [Non-text portions of this message have been removed]
      • Stephen West-Fisher
        This is a really old post, this problem is long solved. However, if anyone has any ideas on how to set a value in a combo reliably.... ... From: Steve
        Message 3 of 3 , Mar 17, 2004
        View Source
        • 0 Attachment
          This is a really old post, this problem is long solved. However, if anyone
          has any ideas on how to set a value in a combo reliably....

          -----Original Message-----
          From: Steve West-Fisher [mailto:steve@...]
          Sent: Thursday, February 12, 2004 11:59 AM
          To: perlguitest@yahoogroups.com
          Subject: [perlguitest] Working with combos


          I'm having a lot of trouble trying to set the value in a combo. If I
          just use SendKeys, the value changes as each key is sent, which will
          not work (I know exacly what value I want).

          So I thought I'd try WMSetText. But I need the handle of the combo.
          I cannot get FindWindowLike to work because the control id changes
          each time this window comes up.

          So, any other ideas for getting the handle of the combo? It does
          have focus, but I don't see how to get the handle of the widget with
          focus.






          Yahoo! Groups Links
        Your message has been successfully submitted and would be delivered to recipients shortly.