| 152 | } |
| 153 | |
| 154 | BOOL CFileList::InitBox(UINT res, CWnd *parent, LPSTR lpszPath, LPSTR lpszFileMask, UINT flags, UINT msg, |
| 155 | void (*cb)(char *)) { |
| 156 | m_nFlag = flags; |
| 157 | m_csPath = lpszPath; |
| 158 | m_csFileMask = lpszFileMask; |
| 159 | m_nMsg = msg; |
| 160 | m_cwndParent = parent; |
| 161 | callback = cb; |
| 162 | |
| 163 | // let's check if a \ is the last letter in the path |
| 164 | if (m_nFlag == DRIVES || m_nFlag == DIRECTORIES) { |
| 165 | if (m_csPath.Right(1) != "\\") |
| 166 | m_csPath += "\\"; |
| 167 | } |
| 168 | |
| 169 | // subclassing the dialog-template listbox |
| 170 | if (SubclassDlgItem(res, parent) == FALSE) |
| 171 | return FALSE; |
| 172 | |
| 173 | return FillBox(); |
| 174 | } |
| 175 | |
| 176 | // by double-clicking .. in a drive-box the |
| 177 | // path will get longer and longer such as |