浏览对话框的调用实现

代码:
char buf[255];
ZeroMemory(buf, sizeof(buf));
BROWSEINFO bi;
bi.hwndOwner = m_hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = buf;
bi.lpszTitle = "请选择保存路径";
bi.ulFlags = 0;
bi.lpfn = NULL;
bi.lParam = 0;
bi.iImage = 0;
LPITEMIDLIST lp = SHBrowseForFolder(&bi);
if(lp!=NULL)SHGetPathFromIDList(lp,buf);
m_FileSavePath.Format("%s",buf);
GetDlgItem(IDC_STATIC2)->SetWindowText(buf);
浙公网安备 33010602011771号