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

Problems with GetListViewContents

Expand Messages
  • jonnyroberts1978
    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,
    Message 1 of 5 , Dec 19, 2006
    • 0 Attachment
      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?


      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);
      $NumberOfElementsInArray = scalar(@list1);
      print $w;
      printf("The item is %d \n", $NumberOfElementsInArray);
      if (%list1 >= 1 ) {
      foreach my $s (@list1) {
      print($s);
      }
      }
      }
      }
    • Earthlink-m_ryan
      Jonny wrote, ... use Win32::GuiTest qw(GetListViewContents IsWindowVisible WaitWindowLike FindWindowLike SetForegroundWindow ); use strict; use warnings; ...
      Message 2 of 5 , Dec 19, 2006
      • 0 Attachment
        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.

        [Non-text portions of this message have been removed]
      • m_ryan_1
        ... wrote: Jonny wrote, ... use Win32::GuiTest qw(GetListViewContents IsWindowVisible WaitWindowLike FindWindowLike SetForegroundWindow
        Message 3 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 4 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 5 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.