Dephi中有FileListBox控件,DirectoryListBox控件,DriveComboBox控件,利用他们可以很好的显示文件,文件夹,驱动器列表。请问vc中是否有这样的控件或者类。

解决方案 »

  1.   

    int nResult=this->DlgDirListComboBox(szPath,IDC_MY_COMBOX,
      IDC_DIR_STATIC,DDL_READWRITE|DDL_READONLY|DDL_HIDDEN|DDL_SYSTEM|
      DDL_DIRECTORY|DDL_ARCHIVE);-----------------
      

  2.   

    CWnd::DlgDirListComboBox  
    int DlgDirListComboBox( LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType );Return ValueSpecifies the outcome of the function. It is nonzero if a listing was made, even an empty listing. A 0 return value implies that the input string did not contain a valid search path.ParameterslpPathSpecPoints to a null-terminated string that contains the path or filename. DlgDirListComboBox modifies this string, which should be long enough to contain the modifications. For more information, see the following “Res” section.nIDComboBoxSpecifies the identifier of a combo box in a dialog box. If nIDComboBox is 0, DlgDirListComboBox assumes that no combo box exists and does not attempt to fill one.nIDStaticPathSpecifies the identifier of the static-text control used to display the current drive and directory. If nIDStaticPath is 0, DlgDirListComboBox assumes that no such text control is present.nFileTypeSpecifies DOS file attributes of the files to be displayed. It can be any combination of the following values: DDL_READWRITE   Read-write data files with no additional attributes.
    DDL_READONLY   Read-only files.
    DDL_HIDDEN   Hidden files.
    DDL_SYSTEM   System files.
    DDL_DIRECTORY   Directories.
    DDL_ARCHIVE   Archives.
    DDL_POSTMSGS   CB_DIR flag. If the CB_DIR flag is set, Windows places the messages generated by DlgDirListComboBox in the application’s queue; otherwise, they are sent directly to the dialog-box procedure.
    DDL_DRIVES   Drives. If the DDL_DRIVES flag is set, the DDL_EXCLUSIVE flag is set automatically. Therefore, to create a directory listing that includes drives and files, you must call DlgDirListComboBox twice: once with the DDL_DRIVES flag set and once with the flags for the rest of the list.
    DDL_EXCLUSIVE   Exclusive bit. If the exclusive bit is set, only files of the specified type are listed; otherwise normal files and files of the specified type are listed. 
    ---------------
    CWnd::DlgDirList  
    int DlgDirList( LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType );CWnd::DlgDirSelect  
    BOOL DlgDirSelect( LPTSTR lpString, int nIDListBox 
      

  3.   

    当然用过!
    需要一个工程吗?
    [email protected]
      

  4.   

    需要。你怎么把哪个工程给我?发到我信箱吧。[email protected]