MCPcopy Create free account
hub / github.com/bumptop/BumpTop / GetShellFolderFromAbsDirPath

Method GetShellFolderFromAbsDirPath

trunk/win/Source/BT_WindowsOS.cpp:4327–4352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4325}
4326
4327IShellFolder2 * WindowsSystem::GetShellFolderFromAbsDirPath( QString p )
4328{
4329 // Assumes given path is a directory
4330
4331 LPITEMIDLIST pidl = NULL;
4332 IShellFolder2 * psfFolder = NULL;
4333
4334 // namespace extension root (desktop) for parsing path
4335 LPSHELLFOLDER psfDesktop = NULL;
4336 if (FAILED(SHGetDesktopFolder(&psfDesktop)))
4337 return psfFolder;
4338
4339 // parse path for absolute pidl, and connect to target folder
4340 if (FAILED(psfDesktop->ParseDisplayName(NULL, NULL, (LPWSTR) p.utf16(), NULL, &pidl, NULL)))
4341 return psfFolder;
4342
4343 // now get the parent shell folder
4344 if (FAILED(psfDesktop->BindToObject(pidl, NULL, IID_IShellFolder2, (void**)&psfFolder)))
4345 return psfFolder;
4346
4347 // cleanup
4348 CoTaskMemFree(pidl);
4349 psfDesktop->Release(); // no longer required
4350
4351 return psfFolder;
4352}
4353
4354
4355LPITEMIDLIST WindowsSystem::GetAbsolutePidlFromAbsFilePath( QString p )

Callers 4

getMenuMethod · 0.80
RegisterHandlerMethod · 0.80
InitiateDragMethod · 0.80

Calls 1

ReleaseMethod · 0.45

Tested by

no test coverage detected