filedialogext.cpp

来自「Password Safe Password Safe is a passwor」· C++ 代码 · 共 56 行

CPP
56
字号
/// \file FileDialogExt.cpp//-----------------------------------------------------------------------------#include "stdafx.h"#include "PasswordSafe.h"#include "FileDialogExt.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif//-----------------------------------------------------------------------------IMPLEMENT_DYNAMIC(CFileDialogExt, CFileDialog)CFileDialogExt::CFileDialogExt(BOOL bOpenFileDialog,                               LPCTSTR lpszDefExt,                               LPCTSTR lpszFileName,                               DWORD dwFlags,                               LPCTSTR lpszFilter,                               CWnd* pParentWnd)   : CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName,                 dwFlags, lpszFilter, pParentWnd){   m_ext = lpszDefExt;}BEGIN_MESSAGE_MAP(CFileDialogExt, CFileDialog)END_MESSAGE_MAP()BOOLCFileDialogExt::OnFileNameOK(){   if (m_ext != NULL)   {      if (GetFileExt() != m_ext          && GetFileExt() != "")      {         CString temp = m_ext;         temp = "This file type must have a ."            + temp            + " extension.";         MessageBox(temp, "File name error", MB_OK|MB_ICONWARNING);         return 1;      }   }   return CFileDialog::OnFileNameOK();}//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?