Click to See Complete Forum and Search --> : initing BROWSEINFO for SHBrowseForFolder


sperlis
March 28th, 2004, 07:26 AM
Hi everyone.
I'm having dificulties initializing the pidlRoot variable in the BROWSEINFO struct with my own path.
Does anyone have a good (i.e. clear - reading the MSDN just takes me in circles...) explanation of how to use and create ITEMIDLIST? (for a specific path, not a known shell CIDL).

Thanks,

RussG1
March 28th, 2004, 07:48 PM
You can use SHParseDisplayName to create that value for you.
i.e.

LPITEMIDLIST pItemIDList = new ITEMIDLIST;
// the path you want to convert
LPCWSTR pszName = L"C:\\Windows";
SHParseDisplayName(pszName, 0, &pItemIDList, 0, 0);
// then set the pidlroot value of your BROWSEINFO var
browseInfo.pidlRoot = pItemIDList;

sperlis
March 29th, 2004, 04:03 AM
GREAT!
Thanks. I'm rather new to Shell API, and the MSDN was taking me around in circles.
There is a little mater of version competability (for VS6 the MicroSoft SDK is required) but it works great!.

Thanks again.