• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 664
  • Last Modified:

TreeView + SendMessage

I have a TreeView from a program ("SysTreeView32")

I was trying to make it pull some of the node's text out but I couldn't figure out how.

I can find the TreeView and everything, get the count with TVM_GETCOUNT, etc.  I thought TVM_GETITEM might do it but apparently, by other coding I saw, that's not what it does.  So how do I pull all of the node's text (or label, maybe) out and add them to a listbox.

Also, if I could just get the child nodes.  Like:

Main
 -- Word1
 -- Word2
 -- Word3
Main2
 -- Word4
 -- Word5
 -- Word6
Main3
 -- Word7

If I could just get the "Word1", "Word2", ..., "Word7" 's out, that would be good.  I just couldn't figure this one out :(
0
learning_t0_pr0gram
Asked:
learning_t0_pr0gram
  • 7
  • 6
1 Solution
 
learning_t0_pr0gramAuthor Commented:
Also, this doesn't HAVE to be done using SendMessage, I just figured that way would be easiest.  Any way that the items can be pulled out will be fine with me.
0
 
learning_t0_pr0gramAuthor Commented:
Nobody has any ideas on how to do this one?
0
 
ArkCommented:
This is interprocess memory communication issue.
Check out my sample at http://www.freevbcode.com/ShowCode.Asp?ID=3291
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
ArkCommented:
PS. Or search the WEB for Brad Martinez TVDuplicate sample
0
 
learning_t0_pr0gramAuthor Commented:
Your code looks like it might be the way I have to go.  Brad Martinez's only duplicates from the "treeview" control, not from hWnd.

I was looking over your coding example but there are a few things that confuse me.  I have never used half of those API's (GetWindowThreadProcessId, EnumWindows, CopyMemory, etc.).  I'm a little confused as to how I would transfer this over to a ListView instead.  Also, I can get the ToolTip's in this case, so it would be the same.  Could you explain/show me how to convert this over to use a ListView.  I could do it myself if I knew all the API's, but I don't have the time to practice them all and learn them right now.
0
 
ArkCommented:
Brad's code duplicate any SysTreeView32 into VB TreeView control.
As for ListView - seemy sample at
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21384252.html
0
 
learning_t0_pr0gramAuthor Commented:
I actually meant TreeView there, don't know why ListView came out.  :-S

But Brad's function uses the TreeView control.  He doesn't use the hWnd from the TreeView so I can't really convert THIS one over.  His requires a TreeView that is already on the form or part of your project in one way or another.
0
 
ArkCommented:
Hi
Brad's sample use VB TreeView just as output. Brad fill VB treeview manually - first read TV_ITEM structure from remote SysTreeView (using its hwnd) and then fill VB node object. You can use TxetBox or Debug.Print for output instead.
0
 
learning_t0_pr0gramAuthor Commented:
Err, maybe I found different coding.  Could you give me a link to the one you are looking at?  I looked at 9-10 treeview links that had his name and all of them were both controls in the project.

i.e.

function name(variable as TreeView, variable as TreeView)
0
 
learning_t0_pr0gramAuthor Commented:
err, wait, is this what you're talking about?

http://www.web-designer-india.com/Pages/W2/C467.html
0
 
learning_t0_pr0gramAuthor Commented:
Ahhh, precicely what I needed.  Thanks for the help.  I added another 20 points for the confusion.
0
 
ArkCommented:
Thanks for points, glad I could help you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now