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

Method OnInitDialog

WinArk/GotoKeyDlg.cpp:15–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15LRESULT CGotoKeyDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
16 CenterWindow(GetParent());
17
18 GetDlgItem(IDOK).EnableWindow(!m_Key.IsEmpty());
19
20 m_List.Attach(GetDlgItem(IDC_KEY_LIST));
21 m_List.SetExtendedListViewStyle(LVS_EX_DOUBLEBUFFER | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
22 ::SetWindowTheme(m_List, L"Explorer", L"");
23
24 auto cm = GetColumnManager(m_List);
25
26 cm->AddColumn(L"Name", 0, 150);
27 cm->AddColumn(L"Path", 0, 650);
28 cm->UpdateColumns();
29
30 const struct {
31 PCWSTR name;
32 PCWSTR path;
33 } locations[] = {
34 { L"Services", LR"(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services)" },
35 { L"Hardware", LR"(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Enum)" },
36 { L"Device Classes", LR"(HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class)" },
37 { L"Hive List", LR"(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist)" },
38 { L"Image File Execution Options", LR"(HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options)" },
39 { L"Explorer Context Menu 1",LR"(HKEY_CLASSES_ROOT\*\shell)"},
40 { L"Explorer Context Menu 2",LR"(HKEY_CLASSES_ROOT\*\shellex)"},
41 { L"Explorer Context Menu 3",LR"(HKEY_CLASSES_ROOT\AllFileSystemObjects\ShellEx\ContextMenuHandlers)"},
42 { L"Explorer Context Menu 4",LR"(HKEY_CLASSES_ROOT\Folder\shell)" },
43 { L"Explorer Context Menu 5",LR"(HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers)" },
44 { L"Explorer Context Menu 6",LR"(HKEY_CLASSES_ROOT\Directory\shell)" },
45 { L"Explorer Context Menu 7",LR"(HKEY_CLASSES_ROOT\Directory\Background\shell)" },
46 { L"Explorer Context Menu 8",LR"(HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers)" },
47 { L"Run 1",LR"(HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run)"},
48 { L"Run 2",LR"(HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run)"},
49 { L"Run 3",LR"(HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run)"},
50 { L"Run 4",LR"(HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run)"},
51 { L"RunOnce 1",LR"(HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce)"},
52 { L"RunOnce 2",LR"(HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce)"},
53 { L"RunOnceEx 1",LR"(HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx)"},
54 { L"RunOnceEx 2",LR"(HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx)"},
55 { L"Application Registration",LR"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths)"},
56 { L"Eventlog",LR"(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog)"},
57 { L"ServiceGroupOrder",LR"(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder)"},
58 { L"Winlogon",LR"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon)"},
59 { L"Winmgmt",LR"(HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Winmgmt)"},
60 { L"DisallowRun",LR"(HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun)"},
61 { L"Session Manager",LR"(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager)"}
62 };
63
64 for (const auto& [name, path] : locations) {
65 ListItem item{ name,path};
66 m_Items.push_back(item);
67 }
68 UpdateList(m_List, m_Items.size());
69
70 return 0;
71}
72

Callers

nothing calls this directly

Calls 6

IsEmptyMethod · 0.80
AddColumnMethod · 0.80
UpdateColumnsMethod · 0.80
push_backMethod · 0.80
AttachMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected