Solved

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

Posted on 2006-10-28
2
460 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

816 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now