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? |