| 1188 | } |
| 1189 | |
| 1190 | AppCommandCallback<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 | |
| 1211 | LRESULT CRegistryManagerView::OnEditPaste(WORD, WORD, HWND, BOOL&){ |
| 1212 | if (m_Clipboard.Items.empty()) { |