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

745Re: getting contents of lists (GetListContents)

Expand Messages
  • duaneg40
    Feb 2 4:24 AM
    • 0 Attachment
      Dennis,
      Thanks for the response.
      1) The FindWindowLike() call I used returns a SysListView32
      window class (the regular expression is just a little shorter
      than the full name), so I seem to be using the correct window class.
      2) There doesn't seem to be a GetListViewContents in the 1.5-ad
      build (I am already using running under ActivePerl) ... The
      new DibSect class is awesome though ...
      bash-2.05$ grep GetListViewContents *
      bash-2.05$ grep GetListContents *
      changes: - Added GetComboText, GetComboContents, GetListText and
      GetListContents
      guitest.pm: GetForegroundWindow GetListContents GetListText
      GetMenu GetParent
      guitest.pm:=item @lst = GetListContents(hWnd)
      guitest.xs:GetListContents(hWnd)
      readme: @lst = GetListContents(hWnd)
      readme.html:<dt><strong><a name="item_getlistcontents">@lst =
      <code>GetListContents(hWnd)</code></a></strong><br />
      bash-2.05$
      3) I looked at the Windows documentation:
      http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shell
      cc/platform/commctls/listboxes/aboutlistboxes.asp
      and the code in the release, and it all looks good to me. I have
      a SendMessage() call in my example code to see if I can return the
      correct list length, and that returns "0", so it makes so sense that
      the list returned in empty. However, on the screen it seems apparent
      that the list has two elements ... I am at a loss as what
      to try next ... Even the simple SendMessage() test case seems
      to fail ... There are no examples of SendMessage() in the
      release "eg/" directory ... It would be great to have just
      one small example as a test case.



      --- In perlguitest@yahoogroups.com, "Dennis K. Paulsen"
      <ctrondlpaulsden@y...> wrote:
      >
      >
      > 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