MCPcopy Create free account
hub / github.com/derceg/explorerplusplus / OnCreateNewFolder

Method OnCreateNewFolder

Explorer++/Explorer++/MainMenuHandler.cpp:211–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211void 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
248void Explorerplusplus::OnResolveLink()
249{

Callers

nothing calls this directly

Calls 6

LoadStringFunction · 0.85
GetDirectoryIdlMethod · 0.80
QueueRenameMethod · 0.80
getMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected