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

743Re: getting contents of lists (GetListContents)

Expand Messages
  • Dennis K. Paulsen
    Feb 1, 2005
    • 0 Attachment
      The control you'd be working with should be a SysListView32 control;
      and GetListContents only works on list boxes... You'll want to use
      the GetListViewContents function from the CVS build of Win32-
      GuiTest; which is available at
      http://sourceforge.net/projects/winguitest....

      P.S. To everyone: How is the CVS build working?


      Regards,
      D
      --- In perlguitest@yahoogroups.com, "duaneg40" <duaneg40@y...> wrote:
      >
      >
      >
      > Do anyone have an example of how to use GetListContents. I can
      > not seem to get it to work. I have tried building a simple
      > example based on Notepad, and that does not work either.
      >
      > Here is my example:
      > use strict;
      > use IO::File;
      > autoflush STDOUT 1;
      > use Win32::GuiTest qw(FindWindowLike SendKeys);
      >
      > if (1==1){
      > my @windows = FindWindowLike(0,"- Notepad",0);
      > my $wind_cnt = @windows;
      > (@windows == 1) or die "Notebook not/multiple active
      > (cnt=$wind_cnt)\n ";
      > my $top_win = $windows[0];
      >
      > (Win32::GuiTest::SetForegroundWindow($top_win)) or die;
      > SendKeys("%FO"); ## open up file menu
      > sleep(1);
      > my @wind2 = FindWindowLike(0,"Open","327");
      > (@wind2==1) or die "cnt=".@wind2."\n ";
      > my @wind3 = FindWindowLike($wind2[0],0,"SysList");
      > (@wind3==1) or die;
      > my $LB_GETCOUNT = 395;
      > ## this returns Zero -->should be 2
      > my $cnt = Win32::GuiTest::SendMessage($wind3
      [0],$LB_GETCOUNT,0,0);
      > my @list1 = Win32::GuiTest::GetListContents($wind3[0]);
      > my $text1 = join(";",@list1);
      > print "Test1='$text1' ".@list1." [$cnt]\n";
      > exit(0);
      > }
      >
      > The program prints: Test='' 0 [0]
      > I would expect: Test='My eBooks;My Pictures' 2 2
      >
      > Any ideas??
      > Thanks,
      > Duane
    • Show all 9 messages in this topic