| 394 | } |
| 395 | |
| 396 | LRESULT CRegistryManagerView::OnBuildTree(UINT, WPARAM, LPARAM, BOOL&) { |
| 397 | InitTree(); |
| 398 | auto showExtra = AppSettings::Get().ShowExtraHive(); |
| 399 | m_Tree.LockWindowUpdate(); |
| 400 | |
| 401 | int i = 0; |
| 402 | for (auto& k : Registry::Keys) { |
| 403 | if (!showExtra && ++i == 6) |
| 404 | break; |
| 405 | auto hItem = BuildTree(m_hStdReg, k.hKey, k.text); |
| 406 | SetNodeData(hItem, NodeType::Key | NodeType::Predefined); |
| 407 | } |
| 408 | m_Tree.Expand(m_hStdReg, TVE_EXPAND); |
| 409 | |
| 410 | auto hKey = Registry::OpenRealRegistryKey(); |
| 411 | if (hKey) { |
| 412 | CRegKey key(hKey); |
| 413 | BuildTree(m_hRealReg, key); |
| 414 | m_Tree.Expand(m_hRealReg, TVE_EXPAND); |
| 415 | } |
| 416 | m_Tree.LockWindowUpdate(FALSE); |
| 417 | |
| 418 | if (!m_StartKey.IsEmpty()) { |
| 419 | auto hItem = GotoKey(m_StartKey); |
| 420 | if (!hItem) { |
| 421 | AtlMessageBox(m_hWnd, (PCWSTR)(L"Failed to locate key " + m_StartKey), IDS_TITLE, MB_ICONWARNING); |
| 422 | } |
| 423 | } |
| 424 | m_Tree.SetFocus(); |
| 425 | |
| 426 | return 0; |
| 427 | } |
| 428 | |
| 429 | CString CRegistryManagerView::GetFullNodePath(HTREEITEM hItem) const { |
| 430 | CString path; |