| 1017 | |
| 1018 | |
| 1019 | int CALLBACK FileSelectFolderCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) |
| 1020 | { |
| 1021 | if (uMsg == BFFM_INITIALIZED) // Caller has ensured that lpData isn't NULL by having set a valid lParam value. |
| 1022 | SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData); |
| 1023 | // In spite of the quote below, the behavior does not seem to vary regardless of what value is returned |
| 1024 | // upon receipt of BFFM_VALIDATEFAILED, at least on XP. But in case it matters on other OSes, preserve |
| 1025 | // compatibility with versions older than 1.0.36.03 by keeping the dialog displayed even if the user enters |
| 1026 | // an invalid folder: |
| 1027 | // MSDN: "Returns zero except in the case of BFFM_VALIDATEFAILED. For that flag, returns zero to dismiss |
| 1028 | // the dialog or nonzero to keep the dialog displayed." |
| 1029 | return uMsg == BFFM_VALIDATEFAILED; // i.e. zero should be returned in almost every case. |
| 1030 | } |
| 1031 | |
| 1032 | |
| 1033 |
nothing calls this directly
no outgoing calls
no test coverage detected