Help setting SHBrowseForFolder(...) root please
I am using SHBrowseForFolder(...) to have the user select a folder. As you know, this function takes as an argument to configure it, a BROWSEINFO structure. I need to set as the root path, the current working directory. The field of the BROWSEINFO structure that specifies the root path requires an ITEMIDLIST containing the path. I can get the current working directory as a null-terminated string using GetCurrentDirectory(...):
What I need to find:
- some way to create an ITEMIDLIST from a null-terminated string containing a path
- some way to directly create an ITEMIDLIST of the current working directory
I can not find either. There is a function SHGetPathFromIDList to extract the path from an ITEMIDLIST and put it into a buffer as a null-terminated string, but I can not find a function similiar to go in the opposite direction.
I would appreciate any suggestions. Surely there must be a simple means of doing such a common seeming task?