How to check if Folder is a Special Shell Folder ?
Answer / Aman Rathi
To check if a folder is a special shell folder in Win32API code, you can use the IShellFolder interface's ParseDisplayName function. Here's an example:n`nSTDMETHODIMP CMyFolder::ParseDisplayName(IPersistFile* pPersistFile, LPOLESTR *ppnameOut, IMONIKER **ppMk, IBindCtx **ppbc)n{nIUnknown *pUnk = nullptr;nIShellFolder *pShellFolder = nullptr;nHRESULT hr = S_OK;nnhr = pPersistFile->Load(ppnameOut, STGM_READ | STGM_DELAYED_WRITE);nif (SUCCEEDED(hr)) {nhr = CoCreateInstance(CLSID_ShellFolder, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pUnk));nif (SUCCEEDED(hr)) {nIShellDispatch *pShellDispatch;nh = pUnk->QueryInterface(IID_PPV_ARGS(&pShellDispatch));nif (SUCCEEDED(hr)) {nIFolder *pFolder;nhr = pShellDispatch->GetParent((OLECHAR**)&ppnameOut, &pFolder);nif (SUCCEEDED(hr)) {nhr = pFolder->QueryInterface(IID_IShellFolder, (void **)&pShellFolder);npFolder.Release();n}n}n}n}nIFolder *pSpecialFolder;nh = pShellFolder->ParseDisplayName(pbc, NULL, ppnameOut, &pSpecialFolder);nIFCObject::Release(pUnk);nIFCObject::Release(pShellFolder);npSpecialFolder.Release();nrtruntime_assert(SUCCEEDED(hr));nreturn hr;n};n`
| Is This Answer Correct ? | 0 Yes | 0 No |
How to get Filename from Path?
What is the functionality of GetWindowText?
How to check if Folder is a Special Shell Folder ?
How to Check if Folder Exists?
What is the functionality of FindWindow?
How to Get File Extension?
What is the functionality of SendMessage?
Plrase send project in vb.net on hotel management.
What is the functionality of GetWindow?
What is the functionality of EnumWindows?
How to Check if File Exists?
What is the functionality of GetWindowTextLength?