Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Enumerate a Win32 Treeview

by BrowserUk (Patriarch)
on Jul 25, 2005 at 21:54 UTC ( [id://477989]=note: print w/replies, xml ) Need Help??


in reply to Enumerate a Win32 Treeview

This should help. It sounds like TVM_GETNEXTITEM with the various flags are what you need.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^2: Enumerate a Win32 Treeview
by slloyd (Hermit) on Jul 25, 2005 at 22:07 UTC
    Can I access Macros with Win32::API? What dll do I reference? I am not sure how to access a Win32 macro via Perl. Any ideas?

      No, you cannot use the macros, but you should be able to use the Win32::GUI sendmsg() call to send TVM_GETNEXTITEM messages to iterate the contents of the treeview control.

      I don't think that there is an Win32 API call for retrieving that information.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
        ok, still cannot get it to return anything..
        ############### sub getListviewItems{ my $hwnd = shift || return "No treeview handle"; #if no result send a WM_GetText message to the window $WmSendMessage ||= new Win32::API("user32", "SendMessageA", [N, N, + N, P],'N') || return "SendMessageA Error"; my $TV_FIRST=4352; my $TVM_GETNEXTITEM=$TV_FIRST+10; my $text = " " x 2048; my $textLen = 2048; my @items=(); print "calling $hwnd with $TVM_GETNEXTITEM\n"; while(my $result = $WmSendMessage->Call($hwnd,$TVM_GETNEXTITEM, $t +extLen, $text)){ my $item=substr($text, 0, $result); print "getListviewItems: [$item]\n"; push(@items,$item); } return @items; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://477989]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found