Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by Greg Stantin
Wed, 07 May 2003 04:24
Registry and TreeNodes
Author: Greg Stantin
Date: Wed, 07 May 2003 04:24
Date: Wed, 07 May 2003 04:24
26 lines
1739 bytes
1739 bytes
I have the registry displayed just like regedit in a TreeView
My Computer
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_CONFIG
I am trying to get the rootkeys of the parent and not the actual
root of the tree. For example, if i select an item far below
HKEY_CURRENT_USER, i want it to return HKEY_CURRENT_USER
as the parent node, and not My Computer.
This is what i have.
void __fastcall TForm1::TreeView1Expanding(TObject *Sender,
TTreeNode *Node, bool &AllowExpansion)
{
LPCSTR NameLBSelect = Node->Parent->Text.c_str();
Is there any way that i can get the parent on level 1, without going
to the actual root of the tree, i dont need the rootnode as the
parent.
Thanks in advance
Re: Registry and TreeNodes
Author: Remy Lebeau (TeamB)
Date: Wed, 07 May 2003 07:03
Date: Wed, 07 May 2003 07:03
27 lines
1851 bytes
1851 bytes
"Greg Stantin" <gstantin@stantonassoc.com> wrote in message
news:3eb88a85@newsgroups.borland.com...
> Is there any way that i can get the parent on level 1,
> without going to the actual root of the tree, i dont need
> the rootnode as the parent.
Simply iterate the Parent hierarchy until you find a TreeNode that has its
Level property set to 1:
void __fastcall TForm1::TreeView1Expanding(TObject *Sender, TTreeNode
*Node, bool &AllowExpansion)
{
if( Node->Level != 0 )
{
TTreeNode *ParentNode = Node;
while( (ParentNode) && (ParentNode->Level > 1) )
ParentNode = ParentNode->Parent;
AnsiString NameLBSelect = ParentNode->Text;
// ...
}
}
Gambit
Re: Registry and TreeNodes
Author: Greg Stantin
Date: Wed, 07 May 2003 12:34
Date: Wed, 07 May 2003 12:34
8 lines
1285 bytes
1285 bytes
Thanks very much. "Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message news:3eb8af62$1@newsgroups.borland.com... > > Simply iterate the Parent hierarchy until you find a TreeNode that has its > Level property set to 1:
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads