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

FindWindowLike help

Expand Messages
  • majingaa2z
    Here is my test code. The application opens properly, but then it just hangs, when I close the application it gives me the appended error and then sends ^p to
    Message 1 of 4 , Jul 11 1:10 PM
    • 0 Attachment
      Here is my test code. The application opens properly, but then it
      just hangs, when I close the application it gives me the appended
      error and then sends ^p to STDOUT? I am trying to get ^p to be send
      to the application I opened in the code.

      use Win32::GuiTest qw(:ALL);
      $Win32::GuiTest::debug = 1;
      chdir "Originals";
      my @window = FindWindowLike(0,"^BEACH,BOBBY");
      print @window;
      Win32::GuiTest::SendKeys("^p");

      Use of uninitialized value in string at
      C:/Perl/site/lib/Win32/GuiTest/pm line 565. Using Pattern (^BEACH,
      BOBBY, )

      Also this is my first perl attempt using any mod. I'm really glad I
      found this mod and would love to be able to use as I have a ton of
      things planned for it.

      Sine Certa
      Jon Smith
      ~The unexamined life is not worth living~ Socrates
    • Gábor Szabó
      Do you mean by application the perl script you sent us ? I think it would be better to run it from the command line : c: workplace perl script.pl The
      Message 2 of 4 , Jul 12 1:06 AM
      • 0 Attachment
        Do you mean by "application" the perl script you sent us ?
        I think it would be better to run it from the command line :

        c:\workplace> perl script.pl

        The "hanging" you mention is strange, which version of Win32::GuiTest
        are you using ?

        Also see the two lines I added in your code. Try adding it and
        running again.

        On 7/11/05, majingaa2z <kawamitsutakaa2z@...> wrote:
        > Here is my test code. The application opens properly, but then it
        > just hangs, when I close the application it gives me the appended
        > error and then sends ^p to STDOUT? I am trying to get ^p to be send
        > to the application I opened in the code.
        >
        > use Win32::GuiTest qw(:ALL);
        > $Win32::GuiTest::debug = 1;
        > chdir "Originals";
        > my @window = FindWindowLike(0,"^BEACH,BOBBY");
        > print @window;

        die "Could not find Beach Bobby" if not @window;
        SetForegroundWindow($window[0]);

        > Win32::GuiTest::SendKeys("^p");
        >
        > Use of uninitialized value in string at
        > C:/Perl/site/lib/Win32/GuiTest/pm line 565. Using Pattern (^BEACH,
        > BOBBY, )
        >
        > Also this is my first perl attempt using any mod. I'm really glad I
        > found this mod and would love to be able to use as I have a ton of
        > things planned for it.


        Gábor Szabó
        Perl in Israel http://www.pti.co.il
      • Danny R. Faught
        ... It doesn t look like you re doing anything to give focus to the program you re testing, so that s probably why your key input isn t getting there.
        Message 3 of 4 , Jul 12 8:45 AM
        • 0 Attachment
          > Here is my test code. The application opens properly, but then it
          > just hangs, when I close the application it gives me the appended
          > error and then sends ^p to STDOUT? I am trying to get ^p to be send
          > to the application I opened in the code.

          It doesn't look like you're doing anything to give focus to the program
          you're testing, so that's probably why your key input isn't getting
          there. FindWindowLike doesn't do anything with the focus.

          I haven't figured out yet whether SetForegroundWindow or SetFocus is the
          way way to set the focus. In my code I do a careful dance with the two
          of them.
          --
          Danny R. Faught
          Tejas Software Consulting
          http://tejasconsulting.com/
        • Chris Hilton
          I m not positive this makes a difference, but you also might try: my @window = FindWindowLike(undef, ^BEACH,BOBBY ); Chris Hilton
          Message 4 of 4 , Jul 13 9:48 AM
          • 0 Attachment
            I'm not positive this makes a difference, but you also might try:

            my @window = FindWindowLike(undef, "^BEACH,BOBBY");

            Chris Hilton

            > -----Original Message-----
            > From: perlguitest@yahoogroups.com
            > [mailto:perlguitest@yahoogroups.com] On Behalf Of majingaa2z
            > Sent: Monday, 11 July, 2005 15:11
            > To: perlguitest@yahoogroups.com
            > Subject: [perlguitest] FindWindowLike help
            >
            > Here is my test code. The application opens properly, but
            > then it just hangs, when I close the application it gives me
            > the appended error and then sends ^p to STDOUT? I am trying
            > to get ^p to be send to the application I opened in the code.
            >
            > use Win32::GuiTest qw(:ALL);
            > $Win32::GuiTest::debug = 1;
            > chdir "Originals";
            > my @window = FindWindowLike(0,"^BEACH,BOBBY"); print @window;
            > Win32::GuiTest::SendKeys("^p");
            >
            > Use of uninitialized value in string at
            > C:/Perl/site/lib/Win32/GuiTest/pm line 565. Using Pattern
            > (^BEACH, BOBBY, )
            >
            > Also this is my first perl attempt using any mod. I'm really
            > glad I found this mod and would love to be able to use as I
            > have a ton of things planned for it.
          Your message has been successfully submitted and would be delivered to recipients shortly.