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

Tabbed navigation question

Expand Messages
  • evenprime
    I m useing win32 guitest to automate some unscriptable applications (not something I wrote, no OLE or WMI as options) I m having trouble with tabbed
    Message 1 of 3 , Apr 17, 2005
    • 0 Attachment
      I'm useing win32 guitest to automate some unscriptable applications
      (not something I wrote, no OLE or WMI as options)

      I'm having trouble with tabbed navigation. Where buttons can be
      controlled ala:

      PushChildButton($fgWindow, "^OK\$");

      Tabs seem to have to be clicked with coordinates relative to the
      entire screen, and I can't always guarantee the window I need to
      interact with will open in the same place everytime.

      Is their a way to get those coordinates relative to the active window?
      Better yet, is their a way to determine which tab to activate
      without coordinate based mouse clicks?
    • Chris Hilton
      You can use ClientToScreen and ScreenToClient to convert coordinates back and forth in Win32::GuiTest 1.50.3-ad from CPAN. ($x,$y) = ScreenToClient(hwnd,x,y)
      Message 2 of 3 , Apr 18, 2005
      • 0 Attachment
        You can use ClientToScreen and ScreenToClient to convert coordinates
        back and forth in Win32::GuiTest 1.50.3-ad from CPAN.

        ($x,$y) = ScreenToClient(hwnd,x,y)
        ($x,$y) = ClientToScreen(hwnd,x,y)

        There are also the following functions to work with tabs:

        GetTabItems($window)
        Returns a list of a tab control's labels.

        SelTabItem($window, $idx)
        Selects a tab based off an index (zero-based).

        SelTabItemText($window, $txt)
        Selects a tab based off text label (case insensitive).

        IsTabItemSel($window, $txt)
        Determines if the specified tab item is selected.

        Hope some of that helps.

        Chris Hilton

        -----Original Message-----
        From: perlguitest@yahoogroups.com [mailto:perlguitest@yahoogroups.com]
        On Behalf Of evenprime
        Sent: Sunday, 17 April, 2005 10:24
        To: perlguitest@yahoogroups.com
        Subject: [perlguitest] Tabbed navigation question




        I'm useing win32 guitest to automate some unscriptable applications (not
        something I wrote, no OLE or WMI as options)

        I'm having trouble with tabbed navigation. Where buttons can be
        controlled ala:

        PushChildButton($fgWindow, "^OK\$");

        Tabs seem to have to be clicked with coordinates relative to the entire
        screen, and I can't always guarantee the window I need to interact with
        will open in the same place everytime.

        Is their a way to get those coordinates relative to the active window?
        Better yet, is their a way to determine which tab to activate without
        coordinate based mouse clicks?









        Yahoo! Groups Links
      • Philip Zembrod
        ... You could try to send a TCM_SETCURSEL message to the tab control s handle. TCM_SETCURSEL takes the 0-based index of the desired tab item as WParam and 0 as
        Message 3 of 3 , Apr 19, 2005
        • 0 Attachment
          > Date: Sun, 17 Apr 2005 15:24:29 -0000
          > From: "evenprime" <evenprime@...>
          > Subject: Tabbed navigation question
          >
          > I'm useing win32 guitest to automate some unscriptable applications
          > (not something I wrote, no OLE or WMI as options)
          >
          > I'm having trouble with tabbed navigation. Where buttons can be
          > controlled ala:
          >
          > PushChildButton($fgWindow, "^OK\$");
          >
          > Tabs seem to have to be clicked with coordinates relative to the
          > entire screen, and I can't always guarantee the window I need to
          > interact with will open in the same place everytime.
          >
          > Is their a way to get those coordinates relative to the active window?
          > Better yet, is their a way to determine which tab to activate
          > without coordinate based mouse clicks?

          You could try to send a TCM_SETCURSEL message to the tab control's handle.
          TCM_SETCURSEL takes the 0-based index of the desired tab item as WParam
          and 0 as LParam and should select the tab item.

          Regards
          Philip
        Your message has been successfully submitted and would be delivered to recipients shortly.