// The pointer to my combo box. extern CComboBox* pmyComboBox;// Add all the files and directories in the windows directory. TCHAR lpszWinPath[MAX_PATH], lpszOldPath[MAX_PATH]; ::GetWindowsDirectory(lpszWinPath, MAX_PATH);// Make the windows directory the current directory. ::GetCurrentDirectory(MAX_PATH, lpszOldPath); ::SetCurrentDirectory(lpszWinPath);pmyComboBox->ResetContent(); pmyComboBox->Dir(DDL_READWRITE|DDL_DIRECTORY, _T("*.*"));// Reset the current directory to its previous path. ::SetCurrentDirectory(lpszOldPath);
int Dir( UINT attr, LPCTSTR lpszWildCard );
分别给DDL_DRIVES *.*
列表框就需要自己写了
用Filefind和InsertItem就可以了
extern CComboBox* pmyComboBox;// Add all the files and directories in the windows directory.
TCHAR lpszWinPath[MAX_PATH], lpszOldPath[MAX_PATH];
::GetWindowsDirectory(lpszWinPath, MAX_PATH);// Make the windows directory the current directory.
::GetCurrentDirectory(MAX_PATH, lpszOldPath);
::SetCurrentDirectory(lpszWinPath);pmyComboBox->ResetContent();
pmyComboBox->Dir(DDL_READWRITE|DDL_DIRECTORY, _T("*.*"));// Reset the current directory to its previous path.
::SetCurrentDirectory(lpszOldPath);