Snippet requires Win32::API
sub ListView_GetItem ( $$ ) { # ( $wh_Handle, $RowIndex ) #constants use constant LVIF_TEXT => 0x01; use constant LVM_GETITEMCOUNT => 0x1004; use constant LVM_GETITEM => 0x1005; #LVM_FIRST +5 #types typedef Win32::API::Struct _LV_ITEM => qw( UINT mask; int iItem; int iSubItem; UINT state; UINT stateMask; LPTSTR pszText; int cchTextMax; int iImage; LPARAM lParam; ); #Vars my $handle = shift; my $index = 0; my %Item = {}; #Hash to hold Item info my $LV_Item = Win32::API::Struct->new ( '_LV_ITEM'); $Lv_Item->{mask} = LVIF_TEXT; $Lv_Item->{iItem} = 0; $Lv_Item->{iSubItem} = 1; #LRESULT SendMessage( # # HWND hWnd, // handle of destination window # UINT Msg, // message to send # WPARAM wParam, // first message parameter # LPARAM lParam // second message parameter # ); #LVM_GETITEM #wParam = 0; #lParam = (LPARAM) (LV_ITEM FAR*) pitem; Win32::API->Import( 'USER32', 'LRESULT SendMessage( HWND hWnd, UINT Msg, WPARAM wP +aram, LPARAM lParam)' ) || die "fAILED TO IMPORT sENDmESSAGE\n"; #works Fine $items = SendMessage ($handle,LVM_GETITEMCOUNT,0,0); print "Sendmessage saw $items items\n"; #Causes GPF in Recipient SendMessage ($handle,LVM_GETITEM,0,$Lv_Item) || die "Message Faile +d $!\n"; $text = chop $Lv_Item->{pszText}; print "The text is $text \n!"; return $text; }
In reply to Re: Automation Problem with Win32::GUI and Win32::GUITest
by talwyn
in thread Automation Problem with Win32::GUI and Win32::GUITest
by talwyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |