[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

TreeView + SendMessage

Posted on 2005-04-17
13
Medium Priority
?
624 Views
Last Modified: 2008-02-01
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
Comment
Question by:learning_t0_pr0gram
  • 7
  • 6
13 Comments
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 13804245
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
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 13814752
Nobody has any ideas on how to do this one?
0
 
LVL 28

Expert Comment

by:Ark
ID: 13822075
This is interprocess memory communication issue.
Check out my sample at http://www.freevbcode.com/ShowCode.Asp?ID=3291
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 28

Expert Comment

by:Ark
ID: 13822077
PS. Or search the WEB for Brad Martinez TVDuplicate sample
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 13826531
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
 
LVL 28

Expert Comment

by:Ark
ID: 13829237
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
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 13832821
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
 
LVL 28

Expert Comment

by:Ark
ID: 13838870
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
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 13839140
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
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 13839152
err, wait, is this what you're talking about?

http://www.web-designer-india.com/Pages/W2/C467.html
0
 
LVL 28

Accepted Solution

by:
Ark earned 360 total points
ID: 13839210
0
 
LVL 4

Author Comment

by:learning_t0_pr0gram
ID: 13846862
Ahhh, precicely what I needed.  Thanks for the help.  I added another 20 points for the confusion.
0
 
LVL 28

Expert Comment

by:Ark
ID: 13847021
Thanks for points, glad I could help you
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question