Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

863 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

26 Experts available now in Live!

Get 1:1 Help Now