Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to check if Folder is a Special Shell Folder ?



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

Post New Answer

More Win32API Code Interview Questions

How to get Filename from Path?

1 Answers  


What is the functionality of GetWindowText?

1 Answers  


How to check if Folder is a Special Shell Folder ?

1 Answers  


How to Check if Folder Exists?

1 Answers  


What is the functionality of FindWindow?

1 Answers  


How to Get File Extension?

1 Answers  


What is the functionality of SendMessage?

1 Answers  


Plrase send project in vb.net on hotel management.

0 Answers  


What is the functionality of GetWindow?

1 Answers  


What is the functionality of EnumWindows?

1 Answers  


How to Check if File Exists?

1 Answers  


What is the functionality of GetWindowTextLength?

1 Answers  


Categories