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

To capture the text of the error window

Expand Messages
  • vishal_kharge
    Hello All: I need to capture the text of the allert/error window, not the title. Which function I should use, can you write the simple code for it. Thanks,
    Message 1 of 6 , May 6, 2005
    • 0 Attachment
      Hello All:

      I need to capture the text of the allert/error window, not the title.

      Which function I should use, can you write the simple code for it.

      Thanks,
      Vishal Kharge
    • Dennis K. Paulsen
      Here is one rough example: use Win32::GuiTest qw(:ALL); # Get handle of parent window my ($pWin) = FindWindowLike(0, Calculator ); # Get handle of dialog
      Message 2 of 6 , May 9, 2005
      • 0 Attachment
        Here is one rough example:

        use Win32::GuiTest qw(:ALL);
        # Get handle of parent window
        my ($pWin) = FindWindowLike(0, 'Calculator');
        # Get handle of dialog window (alert window)
        my ($cWin) = FindWindowLike($pWin, 'About Calculator');
        # Get handle of label that contains the pertinent text. 13568
        # is the control id of the label for this application. It is
        recommended that you use WinSpy++ or Spy++ to obtain this handle.
        Alternatively if you know you only have one static label you can
        exclude this parameter from the function.
        my ($sLabel) = FindWindowLike($cWin, undef, 'Static', 13568);
        # Obtain text from label control
        my $txt = GetWindowText($sLabel);
        # Output it to the screen
        print "Label Text: $txt\n";


        Regards,
        D

        --- In perlguitest@yahoogroups.com, "vishal_kharge"
        <vishal_kharge@y...> wrote:
        > Hello All:
        >
        > I need to capture the text of the allert/error window, not the
        title.
        >
        > Which function I should use, can you write the simple code for it.
        >
        > Thanks,
        > Vishal Kharge
      • Nahum Cohen
        Hi, The example works for me just fine. One question: how did you obtain the control id of the label using WinSpy++ ? When I highlight this text field in
        Message 3 of 6 , May 12, 2005
        • 0 Attachment
          Hi,

          The example works for me just fine.
          One question: how did you obtain the control id of the label using WinSpy++ ?
          When I highlight this text field in WinSpy++ I got properties like
          handle, class, control ID and more, but non of them was 13568 like in
          the example.

          How do I get this magic number ?



          On 5/10/05, Dennis K. Paulsen <ctrondlpaulsden@...> wrote:
          >
          > Here is one rough example:
          >
          > use Win32::GuiTest qw(:ALL);
          > # Get handle of parent window
          > my ($pWin) = FindWindowLike(0, 'Calculator');
          > # Get handle of dialog window (alert window)
          > my ($cWin) = FindWindowLike($pWin, 'About Calculator');
          > # Get handle of label that contains the pertinent text. 13568
          > # is the control id of the label for this application. It is
          > recommended that you use WinSpy++ or Spy++ to obtain this handle.
          > Alternatively if you know you only have one static label you can
          > exclude this parameter from the function.
          > my ($sLabel) = FindWindowLike($cWin, undef, 'Static', 13568);
          > # Obtain text from label control
          > my $txt = GetWindowText($sLabel);
          > # Output it to the screen
          > print "Label Text: $txt\n";
          >
          > Regards,
          > D
          >
          > --- In perlguitest@yahoogroups.com, "vishal_kharge"
          > <vishal_kharge@y...> wrote:
          > > Hello All:
          > >
          > > I need to capture the text of the allert/error window, not the
          > title.
          > >
          > > Which function I should use, can you write the simple code for it.
          > >
          > > Thanks,
          > > Vishal Kharge
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
        • pkaluski
          Did you take into account that WinSpy displays in hex and perl in decimal? -Piotr ... WinSpy++ ?
          Message 4 of 6 , May 12, 2005
          • 0 Attachment
            Did you take into account that WinSpy displays in hex and perl in decimal?
            -Piotr

            --- In perlguitest@yahoogroups.com, Nahum Cohen <nahum.cohen@g...> wrote:
            > Hi,
            >
            > The example works for me just fine.
            > One question: how did you obtain the control id of the label using
            WinSpy++ ?
            > When I highlight this text field in WinSpy++ I got properties like
            > handle, class, control ID and more, but non of them was 13568 like in
            > the example.
            >
            > How do I get this magic number ?
            >
            >
            >
            > On 5/10/05, Dennis K. Paulsen <ctrondlpaulsden@y...> wrote:
            > >
            > > Here is one rough example:
            > >
            > > use Win32::GuiTest qw(:ALL);
            > > # Get handle of parent window
            > > my ($pWin) = FindWindowLike(0, 'Calculator');
            > > # Get handle of dialog window (alert window)
            > > my ($cWin) = FindWindowLike($pWin, 'About Calculator');
            > > # Get handle of label that contains the pertinent text. 13568
            > > # is the control id of the label for this application. It is
            > > recommended that you use WinSpy++ or Spy++ to obtain this handle.
            > > Alternatively if you know you only have one static label you can
            > > exclude this parameter from the function.
            > > my ($sLabel) = FindWindowLike($cWin, undef, 'Static', 13568);
            > > # Obtain text from label control
            > > my $txt = GetWindowText($sLabel);
            > > # Output it to the screen
            > > print "Label Text: $txt\n";
            > >
            > > Regards,
            > > D
            > >
            > > --- In perlguitest@yahoogroups.com, "vishal_kharge"
            > > <vishal_kharge@y...> wrote:
            > > > Hello All:
            > > >
            > > > I need to capture the text of the allert/error window, not the
            > > title.
            > > >
            > > > Which function I should use, can you write the simple code for it.
            > > >
            > > > Thanks,
            > > > Vishal Kharge
            > >
            > > Yahoo! Groups Links
            > >
            > >
            > >
            > >
            > >
          • stuart arnold
            Besides Spy++, there s a very good one: WinSpector and its Free. http://www.windows-spy.com/ ... From: perlguitest@yahoogroups.com
            Message 5 of 6 , May 13, 2005
            • 0 Attachment
              Besides Spy++, there's a very good one: WinSpector and its Free.
              http://www.windows-spy.com/
              -----Original Message-----
              From: perlguitest@yahoogroups.com [mailto:perlguitest@yahoogroups.com]
              On Behalf Of Nahum Cohen
              Sent: Thursday, May 12, 2005 7:30 PM
              To: perlguitest@yahoogroups.com
              Subject: Re: [perlguitest] Re: To capture the text of the error window


              Hi,

              The example works for me just fine.
              One question: how did you obtain the control id of the label using
              WinSpy++ ?
              When I highlight this text field in WinSpy++ I got properties like
              handle, class, control ID and more, but non of them was 13568 like in
              the example.

              How do I get this magic number ?



              On 5/10/05, Dennis K. Paulsen <ctrondlpaulsden@...> wrote:
              >
              > Here is one rough example:
              >
              > use Win32::GuiTest qw(:ALL);
              > # Get handle of parent window
              > my ($pWin) = FindWindowLike(0, 'Calculator');
              > # Get handle of dialog window (alert window)
              > my ($cWin) = FindWindowLike($pWin, 'About Calculator');
              > # Get handle of label that contains the pertinent text. 13568
              > # is the control id of the label for this application. It is
              > recommended that you use WinSpy++ or Spy++ to obtain this handle.
              > Alternatively if you know you only have one static label you can
              > exclude this parameter from the function.
              > my ($sLabel) = FindWindowLike($cWin, undef, 'Static', 13568);
              > # Obtain text from label control
              > my $txt = GetWindowText($sLabel);
              > # Output it to the screen
              > print "Label Text: $txt\n";
              >
              > Regards,
              > D
              >
              > --- In perlguitest@yahoogroups.com, "vishal_kharge"
              > <vishal_kharge@y...> wrote:
              > > Hello All:
              > >
              > > I need to capture the text of the allert/error window, not the
              > title.
              > >
              > > Which function I should use, can you write the simple code for it.
              > >
              > > Thanks,
              > > Vishal Kharge
              >
              > Yahoo! Groups Links
              >
              >
              >
              >
              >




              _____

              Yahoo! Groups Links


              * To visit your group on the web, go to:
              http://groups.yahoo.com/group/perlguitest/


              * To unsubscribe from this group, send an email to:
              perlguitest-unsubscribe@yahoogroups.com
              <mailto:perlguitest-unsubscribe@yahoogroups.com?subject=Unsubscribe>


              * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
              Service <http://docs.yahoo.com/info/terms/> .




              [Non-text portions of this message have been removed]
            • Nahum Cohen
              You are right .. Now it s working fine, thanks.
              Message 6 of 6 , May 13, 2005
              • 0 Attachment
                You are right ..
                Now it's working fine, thanks.


                On 5/13/05, pkaluski <pkaluski@...> wrote:
                > Did you take into account that WinSpy displays in hex and perl in decimal?
                > -Piotr
                >
                > --- In perlguitest@yahoogroups.com, Nahum Cohen <nahum.cohen@g...> wrote:
                > > Hi,
                > >
                > > The example works for me just fine.
                > > One question: how did you obtain the control id of the label using
                > WinSpy++ ?
                > > When I highlight this text field in WinSpy++ I got properties like
                > > handle, class, control ID and more, but non of them was 13568 like in
                > > the example.
                > >
                > > How do I get this magic number ?
                > >
                > >
                > >
                > > On 5/10/05, Dennis K. Paulsen <ctrondlpaulsden@y...> wrote:
                > > >
                > > > Here is one rough example:
                > > >
                > > > use Win32::GuiTest qw(:ALL);
                > > > # Get handle of parent window
                > > > my ($pWin) = FindWindowLike(0, 'Calculator');
                > > > # Get handle of dialog window (alert window)
                > > > my ($cWin) = FindWindowLike($pWin, 'About Calculator');
                > > > # Get handle of label that contains the pertinent text. 13568
                > > > # is the control id of the label for this application. It is
                > > > recommended that you use WinSpy++ or Spy++ to obtain this handle.
                > > > Alternatively if you know you only have one static label you can
                > > > exclude this parameter from the function.
                > > > my ($sLabel) = FindWindowLike($cWin, undef, 'Static', 13568);
                > > > # Obtain text from label control
                > > > my $txt = GetWindowText($sLabel);
                > > > # Output it to the screen
                > > > print "Label Text: $txt\n";
                > > >
                > > > Regards,
                > > > D
                > > >
                > > > --- In perlguitest@yahoogroups.com, "vishal_kharge"
                > > > <vishal_kharge@y...> wrote:
                > > > > Hello All:
                > > > >
                > > > > I need to capture the text of the allert/error window, not the
                > > > title.
                > > > >
                > > > > Which function I should use, can you write the simple code for it.
                > > > >
                > > > > Thanks,
                > > > > Vishal Kharge
                > > >
                > > > Yahoo! Groups Links
                > > >
                > > >
                > > >
                > > >
                > > >
                >
                > Yahoo! Groups Links
                >
                >
                >
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.