| 539 | } |
| 540 | |
| 541 | HTREEITEM CRegistryManagerView::GotoKey(const CString& path, bool knownToExist) { |
| 542 | CString spath(path); |
| 543 | spath.MakeUpper(); |
| 544 | if (spath != L'\\') { |
| 545 | if (spath.Find(L'\\') < 0) |
| 546 | spath += L"\\"; |
| 547 | spath.Replace(L"HKLM\\", L"HKEY_LOCAL_MACHINE\\"); |
| 548 | spath.Replace(L"HKCU\\", L"HKEY_CURRENT_USER\\"); |
| 549 | spath.Replace(L"HKCR\\", L"HKEY_CLASSES_ROOT\\"); |
| 550 | spath.Replace(L"HKU\\", L"HKEY_USERS\\"); |
| 551 | spath.Replace(L"HKCC\\", L"HKEY_CURRENT_CONFIG\\"); |
| 552 | } |
| 553 | auto hItem = TreeHelper(m_Tree).FindItem(spath[0] == L'\\' ? m_hRealReg : m_hStdReg, spath); |
| 554 | if (!hItem || knownToExist) { |
| 555 | auto key = Registry::OpenKey(path, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE); |
| 556 | hItem = BuildKeyPath(path, key.Get() != nullptr); |
| 557 | } |
| 558 | |
| 559 | if (hItem) { |
| 560 | m_Tree.SelectItem(hItem); |
| 561 | m_Tree.EnsureVisible(hItem); |
| 562 | m_Tree.SetFocus(); |
| 563 | } |
| 564 | return hItem; |
| 565 | } |
| 566 | |
| 567 | void CRegistryManagerView::UpdateList(bool force) { |
| 568 | m_Items.clear(); |
nothing calls this directly
no test coverage detected