Archived

This topic is now archived and is closed to further replies.

darkchrono4

Browse for folder question

Recommended Posts

I''ve got the thing working and can get the file name when the user selects a folder from the tree and presses OK. But how do I get the file name when the user types it in the edit box and presses OK? Seems just to pass back a empty string.

Share this post


Link to post
Share on other sites
This is what I got:

LPITEMIDLIST ItemID;

bi.hwndOwner = hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = szName;
bi.lpszTitle = NULL;
bi.ulFlags = BIF_EDITBOX;
bi.lpfn = BrowseCallbackProc;
bi.lParam = (LPARAM)pathname;
bi.iImage = 0;

if (ItemID = SHBrowseForFolder(&bi))
{
SHGetPathFromIDList(ItemID, dirpath);

return dirpath;
}
else
{
return NULL;
}

It works fine if you select from the directory tree. Just nothing if you type in a path.

[edited by - darkchrono4 on April 29, 2003 9:09:00 PM]

Share this post


Link to post
Share on other sites