MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / GotoKey

Method GotoKey

WinArk/View.cpp:541–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541HTREEITEM 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
567void CRegistryManagerView::UpdateList(bool force) {
568 m_Items.clear();

Callers

nothing calls this directly

Calls 5

TreeHelperClass · 0.85
FindMethod · 0.80
ReplaceMethod · 0.80
FindItemMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected