我使用mfc打开保存路径,我想点击打开保存路径不允许点击主窗口,我的代码打开保存路径:
void CFTPDlg::OnBnClickedButtonSave()
{
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(bi));
TCHAR szDisplayName[MAX_PATH];
szDisplayName[0] = ' ';
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = szDisplayName;
bi.lpszTitle = _T("Please select a folder for storing received files :");
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lParam = NULL;
bi.iImage = 0;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
TCHAR szPathName[MAX_PATH];
if (NULL != pidl)
{
BOOL bRet = SHGetPathFromIDList(pidl,szPathName);
if(FALSE == bRet)
return;
//AfxMessageBox(szPathName);
m_editSave = szPathName;
((CEdit*)GetDlgItem(IDC_EDIT_SAVE))->SetWindowText(szPathName);
}
}
非常感谢
答案 0 :(得分:0)
将所有者窗口设置为正确的主窗口。否则,模态对话框无法禁用您的窗口。