j***@gmail.com
2014-04-15 01:11:07 UTC
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);
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);