Solved

Read a Treeview Node Text, if I now the TreeView Handle

Posted on 2006-10-28
2
463 Views
Last Modified: 2008-02-26
How can I read a external Current selected TreeView Node Text, if I now the Treeview Handle?

Thanks,

Felipe.

0
Comment
Question by:felipesch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
ewilde earned 500 total points
ID: 17827933

var
  hi : HTreeItem
  Item: TTVItem;
begin
  hi:=TreeView_GetSelection(Handle); //  the handle of the treeview
  Item.hItem := hi;
  Item.mask := TVIF_PARAM;
  if TreeView_GetItem(Handle, Item) then Result := TTreeNode(Item.lParam)
end;

i produced this example while looking into unit ComCtrls.pas:

function TCustomTreeView.GetSelection: TTreeNode;
and
function TTreeNodes.GetNode(ItemId: HTreeItem): TTreeNode;

and also Commctrl.pas:
function TreeView_GetSelection(hwnd: HWND): HTreeItem;
and
function TreeView_GetItem(hwnd: HWND; var pitem: TTVItem): Bool;


regards,
ewilde.
0
 
LVL 11

Expert Comment

by:calinutz
ID: 17828790
0

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.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

689 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