若有组件可用,各位请指点一二,由其是它的消息.

解决方案 »

  1.   

    不过是函数哦,不是控件int CCtrlServerDlg::SelFolder(HWND hParent, CString &strFolder)
    {
        strFolder.Empty();

        LPMALLOC lpMalloc;

        if (::SHGetMalloc(&lpMalloc) != NOERROR) return 0;

        char szDisplayName[_MAX_PATH];
        char szBuffer[_MAX_PATH];
        BROWSEINFO browseInfo;
        browseInfo.hwndOwner = hParent;
        browseInfo.pidlRoot = NULL; // set root at Desktop
        browseInfo.pszDisplayName = szDisplayName;
        browseInfo.lpszTitle = "选择你要添加的文件夹";
        browseInfo.ulFlags = BIF_RETURNFSANCESTORS|BIF_RETURNONLYFSDIRS;
        browseInfo.lpfn = NULL;
        browseInfo.lParam = 0;

        LPITEMIDLIST lpItemIDList;
        if ((lpItemIDList = ::SHBrowseForFolder(&browseInfo)) != NULL)
        {
            // Get the path of the selected folder from the    item ID list.
            if (::SHGetPathFromIDList(lpItemIDList, szBuffer))
            {
                // At this point, szBuffer contains the path the user chose.
                if (szBuffer[0] == '\0') return 0;

                // We have a path in szBuffer! Return it.
                strFolder = szBuffer;
                return 1;
            }
            else return 1; // strResult is empty

            lpMalloc->Free(lpItemIDList);
            lpMalloc->Release();
        }
        
    return 1;
    }
      

  2.   

    非常感动!感激!CSDN上无名好汉真多!