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

Method GetDeleteKeyCommandCallback

WinArk/View.cpp:1190–1209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1188}
1189
1190AppCommandCallback<DeleteKeyCommand> CRegistryManagerView::GetDeleteKeyCommandCallback() {
1191 static const auto cb = [this](auto& cmd, bool execute) {
1192 TreeHelper th(m_Tree);
1193 auto real = cmd.GetPath()[0] == L'\\';
1194 auto hParent = th.FindItem(real ? m_hRealReg : m_hStdReg, cmd.GetPath());
1195 ATLASSERT(hParent);
1196 if (execute) {
1197 auto hItem = th.FindChild(hParent, cmd.GetName());
1198 ATLASSERT(hItem);
1199 m_Tree.DeleteItem(hItem);
1200 }
1201 else {
1202 // create the item
1203 auto hItem = InsertKeyItem(hParent, cmd.GetName());
1204 }
1205 return true;
1206 };
1207
1208 return cb;
1209}
1210
1211LRESULT CRegistryManagerView::OnEditPaste(WORD, WORD, HWND, BOOL&){
1212 if (m_Clipboard.Items.empty()) {

Callers

nothing calls this directly

Calls 4

GetPathMethod · 0.80
FindChildMethod · 0.80
GetNameMethod · 0.80
FindItemMethod · 0.45

Tested by

no test coverage detected