+ break;
+
+ case BFFM_SELCHANGED:
+ // note that this doesn't work with the new style UI (MSDN doesn't
+ // say anything about it, but the comments in shlobj.h do!) but we
+ // still execute this code in case it starts working again with the
+ // "new new UI" (or would it be "NewUIEx" according to tradition?)
+ {
+ // Set the status window to the currently selected path.
+ wxString strDir;
+ if ( SHGetPathFromIDList((LPITEMIDLIST)lp,
+ wxStringBuffer(strDir, MAX_PATH)) )
+ {
+ // NB: this shouldn't be necessary with the new style box
+ // (which is resizable), but as for now it doesn't work
+ // anyhow (see the comment above) no harm in doing it
+
+ // need to truncate or it displays incorrectly
+ static const size_t maxChars = 37;
+ if ( strDir.length() > maxChars )
+ {
+ strDir = strDir.Right(maxChars);
+ strDir = wxString(wxT("...")) + strDir;
+ }
+
+ SendMessage(hwnd, BFFM_SETSTATUSTEXT,
+ 0, (LPARAM)strDir.c_str());
+ }
+ }
+ break;
+
+ //case BFFM_VALIDATEFAILED: -- might be used to provide custom message
+ // if the user types in invalid dir name
+ }
+
+ return 0;