Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

840 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