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

Re: Problems with GetListViewContents

Expand Messages
  • m_ryan_1
    ... wrote: Jonny wrote, ... use Win32::GuiTest qw(GetListViewContents IsWindowVisible WaitWindowLike FindWindowLike SetForegroundWindow
    Message 1 of 5 , Dec 20, 2006
    • 0 Attachment
      --- In perlguitest@yahoogroups.com, "jonnyroberts1978"
      <jonnyroberts1978@...> wrote:
      Jonny wrote,

      >Hi,

      >I have been having some problems using GetListViewContents with our
      >application so I thought I would try and get it to work with windows
      >explorer. However, I stil couldn't get it working with explorer. I
      >have added the code I am using below, has anyone got an ideas why it
      >isn't working?

      use Win32::GuiTest qw(GetListViewContents IsWindowVisible
      WaitWindowLike FindWindowLike
      SetForegroundWindow );
      use strict;
      use warnings;

      >my $fgWindow = WaitWindowLike(0, "My Computer", "ExploreWClass");
      >SetForegroundWindow($fgWindow);

      >my @folderView = FindWindowLike(undef,"FolderView",undef, 0x01, 9);

      >foreach my $w ( @folderView ) {
      >if( IsWindowVisible( $w ) )
      >{
      >my @list1 = GetListViewContents($folderView);

      my @list1 = GetListViewContents(@folderView);

      >$NumberOfElementsInArray = scalar(@list1);
      >print $w;
      >printf("The item is %d \n", $NumberOfElementsInArray);
      >if (%list1 >= 1 ) {

      if ($NumberOfElementsInArray >= 1 ) {

      >foreach my $s (@list1) {
      >print($s);

      foreach my $a(@$s[1]){
      print " $a \n";
      }

      >}
      >}
      >}
      >}

      I think this is what you were after. make sure you use strict and
      warnings.

      Matthew Ryan
      703-642-2651
      Administrator/Realtor
      RE/MAX CitySide
      7700 Little River Tpke #305
      Annandale, VA 22003

      http://www.ListingMap.net

      *We will never share your email with anyone without your consent.
      *reply with the word 'remove' in the subject line to stop recieving
      emails from us.

      *We will never share your email with anyone without your consent.
      *reply with the word 'remove' in the subject line to stop recieving
      emails from us.
    • m_ryan_1
      oops, forgot to change- ... foreach my $a(@$s){
      Message 2 of 5 , Dec 20, 2006
      • 0 Attachment
        oops, forgot to change-

        > >foreach my $a(@$s[1]){

        foreach my $a(@$s){
      • jonnyroberts1978
        Thankyou for your help it is now working! Jon.
        Message 3 of 5 , Dec 22, 2006
        • 0 Attachment
          Thankyou for your help it is now working!

          Jon.
        Your message has been successfully submitted and would be delivered to recipients shortly.