Solved

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

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

12 Experts available now in Live!

Get 1:1 Help Now