void CBrowseDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
CFileDialog cfd(true,_T(".jpg"),NULL,OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,_T("Executable Files (*.jpg)|*.jpg|All Files (*.*)|*.*||"),this);
if(cfd.DoModal()==IDOK)
{
m_path = cfd.GetPathName();
m_edit.SetWindowText(m_path);
}
}
void CBrowseDlg::OnBnClickedGetText()
{
// TODO: Add your control notification handler code here
m_edit.GetWindowText(m_path);
MessageBox(m_path);
}
void CBrowseDlg::OnBnClickedCheck()
{
// TODO: Add your control notification handler code here
if(m_path.IsEmpty())
{
MessageBox(_T("the path is null!"));
}
else
{
CString strFileTitle;
CFileFind finder;
BOOL bWorking = finder.FindFile((LPCTSTR)m_path);
while(bWorking)
{
bWorking=finder.FindNextFile();
strFileTitle=finder.GetFileTitle();
}
}
}