예제 #1
0
void CDownloadFileDlg::OnBrowse ( UINT uCode, int nID, HWND hwndCtrl )
{
CMyFileDialog fd ( true );

    if ( IDOK == fd.DoModal(*this) )
        SetDlgItemText ( IDC_LOCAL_FILENAME, fd.m_szFileName );
}
예제 #2
0
파일: Dialog2.cpp 프로젝트: Hao-Wu/MEDA
void CDialog2::OnBrowse() 
{
	// TODO: Add your control notification handler code here
	

	CString Filter= "所有文件(*.*)|*.*|DES加密文件(*.des)|*.des|文本文件(*.txt)|*.txt|";
		//"DES加密文件(*.des)|*.des||";
	
	CMyFileDialog FileDlg (TRUE, NULL, NULL, OFN_HIDEREADONLY, Filter);
	if (!( FileDlg.DoModal() == IDOK ))
	{
		return ;
	}	
	UpdateData(true);
	m_input = FileDlg.GetPathName();
	m_output = "";
	UpdateData(false);
	
	run_type  = DECRYPT; /////////??????????????????????????????????
	//EnableFormatCtls(false);
	//EnableDesCtls(false);
	//EnableMcsCtls(false);
	SetDlgItemText(IDC_Run,"解密");

	if( m_input.Find(".des")>0 || m_input.Find(".DES")>0 )
	{
		oldformat = DES;
		format    = DES;
		BuildOutputFileName();
		//EnableDesCtls(true);
	}
	else
	{
		run_type = ENCRYPT;
		format   = DES;
		oldformat = DES;

		BuildOutputFileName();
		SetDlgItemText(IDC_Run,"加密");
		
		//EnableFormatCtls(true);
		//if( format == DES )
			//EnableDesCtls(true);
		//else
			//EnableMcsCtls(true);
	}
}