jchli...@gmail.com
unread,Apr 14, 2014, 9:13:08 PM4/14/14You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
The following is my code. According to MSDN, when user types in some garbage string in the edit box, the OK button is supposed to be disabled. I am expecting to receive the garbage string and so I can bail out by reminding user. However, it looks like Microsoft is trying to make itself look nice: it is always returning the current selected item in the tree control. This will lead to some unwanted behavior in my application.
Is there some way to force it to disable the OK button or return the garbage string and so I can do some validation by myself? Thanks in advance.
wchar_t outPath[MAX_PATH];
BROWSEINFO bInfo;
::ZeroMemory(&bInfo, sizeof(BROWSEINFO));
bInfo.hwndOwner = parentHWND;
bInfo.pidlRoot = NULL;
bInfo.pszDisplayName = outPath;
bInfo.lpszTitle = (LPCWSTR)caption;
bInfo.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_VALIDATE;
bInfo.lpfn = NULL;
bInfo.lParam = 0;
LPITEMIDLIST lpItem = ::SHBrowseForFolder(&bInfo);