如题

解决方案 »

  1.   

    组合框原本就支持
    int Dir( UINT attr, LPCTSTR lpszWildCard );
    分别给DDL_DRIVES   *.*
    列表框就需要自己写了
    用Filefind和InsertItem就可以了
      

  2.   

    // 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);