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

Re: "Getting characters from an screen and putting them in another one"

Expand Messages
  • ctrondlpaulsden
    Here is some sample code which should help. If it does not, maybe you can tell us more specifics, like what type of controls you are dealing with... # Sample
    Message 1 of 5 , Aug 9, 2002
      Here is some sample code which should help. If it does not, maybe
      you can tell us more specifics, like what type of controls you are
      dealing with...


      # Sample code:

      #! /usr/bin/perl

      use Win32::GuiTest qw/
      FindWindowLike
      WMGetText
      WMSetText
      /;


      # Obtain handle to Notepad window
      my ($win) = FindWindowLike(0, "^Untitled - Notepad", "");
      # Obtain handle to Edit child window
      my ($edit) = FindWindowLike($win, "", "Edit");

      # Place some text into the Edit window
      WMSetText($edit, "Hello, this is sample text.");

      # Get the text BACK from child window
      my $text = WMGetText($edit);

      # Output text recieved to console
      print "Text received: $text\n";


      --- In perlguitest@y..., "hellarleo" <hellarleo@y...> wrote:
      > First, Thanks for your help.
      >
      > However, after use that functions in my code, the text that I get
      was
      > the window text caption, not the data text that I need get.
      > What's wrong?
      >
      > Thanks Again.
      >
      >
      >
      >
      > --- In perlguitest@y..., "ctrondlpaulsden" <ctrondlp@n...> wrote:
      > > If it is something like an edit control, you should be able to
      use
      > > WMGetText to obtain the text and WMSetText to display it on
      another.
      > >
      > > --- In perlguitest@y..., "hellarleo" <hellarleo@y...> wrote:
      > > > Hi Members!
      > > >
      > > > I need to write an script which need to copy a little text at
      > fixed
      > > > position of an Windows application screen and paste it to
      another
      > > one.
      > > > Anyone knows how may a do it?
      > > >
      > > > Best Regards.
    Your message has been successfully submitted and would be delivered to recipients shortly.