in reply to Re: Copy text from a window
in thread Copy text from a window

Thnx, it really works for Notepad. But what I want to do is to copy from an application, that has a child-window with text in it. The coping of this text is limited with the copy/paste procedure.

Replies are listed 'Best First'.
Re^3: Copy text from a window
by wfsp (Abbot) on Mar 03, 2009 at 16:52 UTC
      This tutorial was very helpful. This is the code I wrote:
      use Win32::GuiTest qw( FindWindowLike WMGetText ); use strict; use warnings; my @whnds = FindWindowLike( undef, "^Fjalori elektronik shpjegues" + ); if( !@whnds ){ die "Cannot find window with title/caption Fjalori\n"; }else{ printf( "Window handle of calculator application is %x\n", $wh +nds[ 0 ] ); } my $edit_ctrl_id = 600; #Edit window, 258 Hex my @edit = FindWindowLike( $whnds[ 0 ], undef, "^AEditCtl32", $edi +t_ctrl_id ); if( !@edit ){ die "Cannot find window handle for Edit control\n"; }else{ printf( "Edit window handle is %x\n", $edit[ 0 ] ); } my $result = WMGetText( $edit[ 0 ] ); print $result;
      It runs OK, but there is nothing in the output. It seems that is so because of the window class "AEditCtl32" where I am trying to read. Does it make sense to continue in this direction, or should I try working with buffers?
        I can't help I'm afraid. Now that you have some code it may be worth posting a new question. Hopefully there are monks who have more experience with this aspect of Win32GuiTest than I have. Alternatively you could try posting to the mailing list mentioned in the docs.

        Good luck.