S
Shawn B.
Greetings,
I'm creating a little program that acts as a glorified Registry explorer.
The TreeView doesn't allow you to show a plus sign unless a node has child
nodes, so I need to determine whether a registry key has subkeys and add a
dummy childnode. The way I'm doing this is to populate the child nodes as
the parent is expanded.
However, there are some serious performance implications. First, when I
pouplate the HKEY_CLASSES_ROOT, it takes 3 seconds to add all the subkeys to
the hive. But if I determine whether those subkeys have subkeys, it takes
49 minutes to populate the HIVE. This is obviously unacceptable. So I'm
left with two choices: 1) figure out a more efficient way to determine and
populate the data, or 2) use C++. Every reg explorer I've ever seen takes
milliseconds to populate the nodes as you expand them, and neither of these
programs are written in C#.
Does anyone here know a better approach? Keep in mind, I'm not populate the
subkeys. I'm only determing whether the subkeys have subkeys (at the level
currently visible) and adding a dummy node so you can get the [+] / [-]
symbol to expand/contract the nodes in the TreeView.
Is it the TreeView that's so slow or the Registry objects in the Win32
namespace? I don't have access to a decent profiler so its hard for me to
tell.
Thanks,
Shawn
I'm creating a little program that acts as a glorified Registry explorer.
The TreeView doesn't allow you to show a plus sign unless a node has child
nodes, so I need to determine whether a registry key has subkeys and add a
dummy childnode. The way I'm doing this is to populate the child nodes as
the parent is expanded.
However, there are some serious performance implications. First, when I
pouplate the HKEY_CLASSES_ROOT, it takes 3 seconds to add all the subkeys to
the hive. But if I determine whether those subkeys have subkeys, it takes
49 minutes to populate the HIVE. This is obviously unacceptable. So I'm
left with two choices: 1) figure out a more efficient way to determine and
populate the data, or 2) use C++. Every reg explorer I've ever seen takes
milliseconds to populate the nodes as you expand them, and neither of these
programs are written in C#.
Does anyone here know a better approach? Keep in mind, I'm not populate the
subkeys. I'm only determing whether the subkeys have subkeys (at the level
currently visible) and adding a dummy node so you can get the [+] / [-]
symbol to expand/contract the nodes in the TreeView.
Is it the TreeView that's so slow or the Registry objects in the Win32
namespace? I don't have access to a decent profiler so its hard for me to
tell.
Thanks,
Shawn