Beispiel #1
0
/// [...] フォルダ選択ダイアログを表示してDL先のフォルダを設定する
void	CDLListWindow::OnGetDLFolder(UINT uNotifyCode, int nID, CWindow wndCtl)
{
	CShellFileOpenDialog	dlg(NULL, FOS_PICKFOLDERS);
	if (dlg.IsNull()) {
		CFolderDialog olddlg;
		if (olddlg.DoModal(m_hWnd) == IDOK) {
			m_cmbDLFolder.SetWindowText(olddlg.GetFolderPath());
		}

	} else {
		if (dlg.DoModal(m_hWnd) == IDOK) {
			CString strFilePath;
			dlg.GetFilePath(strFilePath);
			m_cmbDLFolder.SetWindowText(strFilePath);
		}
	}
}
// リストアするフォルダ指定ボタン
void CBackupDialog::OnBrowseRestore() 
{
	UpdateData(TRUE);	// DDX更新

	CString str;

	// フォルダ選択
	CFolderDialog dlg;
	CFileSpec fs(FS_MYDOC);	// デフォルトフォルダ:My Document
	CString strFolder = fs.GetFullSpec();
	dlg.SetDefaultFolder((LPCTSTR)strFolder);
	
	if(dlg.DoModal())
	{
		strFolder = dlg.GetFolderPath();

		// データフォルダ変更
		m_edtRestorePath.SetWindowText(strFolder);

		UpdateData(FALSE);	// DDX更新
	}
}