| 209 | } |
| 210 | |
| 211 | void Explorerplusplus::OnCreateNewFolder() |
| 212 | { |
| 213 | auto pidlDirectory = m_pActiveShellBrowser->GetDirectoryIdl(); |
| 214 | |
| 215 | wil::com_ptr<IShellItem> directoryShellItem; |
| 216 | HRESULT hr = SHCreateItemFromIDList(pidlDirectory.get(), IID_PPV_ARGS(&directoryShellItem)); |
| 217 | |
| 218 | if (FAILED(hr)) |
| 219 | { |
| 220 | return; |
| 221 | } |
| 222 | |
| 223 | FileProgressSink *sink = FileProgressSink::CreateNew(); |
| 224 | sink->SetPostNewItemObserver([this] (PIDLIST_ABSOLUTE pidl) { |
| 225 | ListViewHelper::SelectAllItems(m_hActiveListView, FALSE); |
| 226 | SetFocus(m_hActiveListView); |
| 227 | |
| 228 | m_pActiveShellBrowser->QueueRename(pidl); |
| 229 | }); |
| 230 | |
| 231 | TCHAR newFolderName[128]; |
| 232 | LoadString(m_hLanguageModule, IDS_NEW_FOLDER_NAME, newFolderName, SIZEOF_ARRAY(newFolderName)); |
| 233 | hr = NFileOperations::CreateNewFolder(directoryShellItem.get(), newFolderName, sink); |
| 234 | sink->Release(); |
| 235 | |
| 236 | if(FAILED(hr)) |
| 237 | { |
| 238 | TCHAR szTemp[512]; |
| 239 | |
| 240 | LoadString(m_hLanguageModule, IDS_NEWFOLDERERROR, szTemp, |
| 241 | SIZEOF_ARRAY(szTemp)); |
| 242 | |
| 243 | MessageBox(m_hContainer, szTemp, NExplorerplusplus::APP_NAME, |
| 244 | MB_ICONERROR | MB_OK); |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | void Explorerplusplus::OnResolveLink() |
| 249 | { |
nothing calls this directly
no test coverage detected