是否有已经定义好的比如说Font的设置,打印的设置那样的模板可以调用啊?

解决方案 »

  1.   

    放到按钮函数里CString strPath;
    BROWSEINFO bInfo;
    LPITEMIDLIST pidl;
    ZeroMemory ( (PVOID) &bInfo,sizeof (BROWSEINFO)); bInfo.hwndOwner  = this->m_hWnd;
    bInfo.pszDisplayName = strPath.GetBuffer (MAX_PATH);
    bInfo.lpszTitle  = "";
    bInfo.ulFlags  = BIF_RETURNFSANCESTORS|BIF_RETURNONLYFSDIRS;
    bInfo.lpfn  = NULL;
    bInfo.lParam  = 0;

    if ((pidl = ::SHBrowseForFolder(&bInfo)) == NULL)
    return;
    char temp[MAX_PATH];
    if (::SHGetPathFromIDList(pidl,temp) == FALSE)
    return;
    strPath.Format(temp);
    AfxMessageBox(strPath);