请问各位网友,在vc++6.0中“选择路径“对话框是怎样实现的。其位置在file->new中,click“位置“或"location“后面的...按钮,探出的对话框就是“选择路径“对话框。我想是使用了某个mfc类,大家知道这个对话框是怎样实现的吗?立即给分。

解决方案 »

  1.   

    MSDN中查看一下BROWSEINFOA就OK了:)
      

  2.   

    用SHBrowseForFolder函数
    Displays a dialog box that enables the user to select a Shell folder. 
    LPITEMIDLIST SHBrowseForFolder(
    LPBROWSEINFO lpbi
    ); 
      

  3.   

    CFileDialog FileDlg(TRUE);
    FileDlg.Domodal();
      

  4.   

    用SHBrowseForFolder函数
    Displays a dialog box that enables the user to select a Shell folder. 
    LPITEMIDLIST SHBrowseForFolder(
    LPBROWSEINFO lpbi
    ); 
      

  5.   

    用SHBrowseForFolder函数
    Displays a dialog box that enables the user to select a Shell folder. 
    LPITEMIDLIST SHBrowseForFolder(
    LPBROWSEINFO lpbi
    ); 
      

  6.   

    ~~~我还需要74分~~~~努力挣钱中~~~~~{
    TCHAR szPath[MAX_PATH]; // 显示一个选择路径的对话框
    LPITEMIDLIST pitem;
    BROWSEINFO info;
    ::ZeroMemory(&info,sizeof(info));
    info.hwndOwner=this->m_hWnd;
    info.lpszTitle=_T("选择需要批处理的文件夹:");
    info.ulFlags=BIF_EDITBOX; if(pitem=::SHBrowseForFolder(&info)) {
    ::SHGetPathFromIDList(pitem,szPath);
    m_szPath=szPath;
    UpdateData(FALSE);
    }
    }
      

  7.   

    char  lpBuffer[MAX_PATH], buf[1024]; 
    LPMALLOC pMalloc;
    SHGetMalloc(&pMalloc);
        BROWSEINFO bi;
    int i = 0;
        LPITEMIDLIST pidlBrowse;    // PIDL selected by user   // Fill in the BROWSEINFO structure.
    bi.hwndOwner = m_hWnd; 
        bi.pidlRoot = NULL;
    bi.pszDisplayName = lpBuffer; 
        bi.lpszTitle = "选择HTML文件存放的目录";
    bi.ulFlags = 0; 
        bi.lpfn = NULL;
    bi.lParam = 0;  
        
    // Browse for a folder and return its PIDL. 
        pidlBrowse = SHBrowseForFolder(&bi);
    if (pidlBrowse != NULL)
    {  
            // Show the display name, title, and file system path. 
            if (SHGetPathFromIDList(pidlBrowse, lpBuffer)) 
                  // do something ....        // Free the PIDL returned by SHBrowseForFolder. 
            pMalloc->Free(pidlBrowse);
           }
      

  8.   

    char  lpBuffer[MAX_PATH], buf[1024]; 
    LPMALLOC pMalloc;
    SHGetMalloc(&pMalloc);
        BROWSEINFO bi;
    int i = 0;
        LPITEMIDLIST pidlBrowse;    // PIDL selected by user   // Fill in the BROWSEINFO structure.
    bi.hwndOwner = m_hWnd; 
        bi.pidlRoot = NULL;
    bi.pszDisplayName = lpBuffer; 
        bi.lpszTitle = "选择HTML文件存放的目录";
    bi.ulFlags = 0; 
        bi.lpfn = NULL;
    bi.lParam = 0;  
        
    // Browse for a folder and return its PIDL. 
        pidlBrowse = SHBrowseForFolder(&bi);
    if (pidlBrowse != NULL)
    {  
            // Show the display name, title, and file system path. 
            if (SHGetPathFromIDList(pidlBrowse, lpBuffer)) 
                  // do something ....        // Free the PIDL returned by SHBrowseForFolder. 
            pMalloc->Free(pidlBrowse);
           }
      

  9.   

    char  lpBuffer[MAX_PATH], buf[1024]; 
    LPMALLOC pMalloc;
    SHGetMalloc(&pMalloc);
        BROWSEINFO bi;
    int i = 0;
        LPITEMIDLIST pidlBrowse;    // PIDL selected by user   // Fill in the BROWSEINFO structure.
    bi.hwndOwner = m_hWnd; 
        bi.pidlRoot = NULL;
    bi.pszDisplayName = lpBuffer; 
        bi.lpszTitle = "选择HTML文件存放的目录";
    bi.ulFlags = 0; 
        bi.lpfn = NULL;
    bi.lParam = 0;  
        
    // Browse for a folder and return its PIDL. 
        pidlBrowse = SHBrowseForFolder(&bi);
    if (pidlBrowse != NULL)
    {  
            // Show the display name, title, and file system path. 
            if (SHGetPathFromIDList(pidlBrowse, lpBuffer)) 
                  // do something ....        // Free the PIDL returned by SHBrowseForFolder. 
            pMalloc->Free(pidlBrowse);
           }