// MyExplorer3.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "MyExplorer3.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
BOOL ReadPostfix(TCHAR configfilename[]);
/////////////////////////////////////////////////////////////////////////////
// CMyExplorer3App
BEGIN_MESSAGE_MAP(CMyExplorer3App, CWinApp)
//{{AFX_MSG_MAP(CMyExplorer3App)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyExplorer3App construction
CMyExplorer3App::CMyExplorer3App()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMyExplorer3App object
CMyExplorer3App theApp;
/////////////////////////////////////////////////////////////////////////////
// CMyExplorer3App initialization
BOOL CMyExplorer3App::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
TCHAR AppPath[MAX_PATH];
GetModuleFileName(::GetModuleHandle(NULL), AppPath, sizeof(AppPath)/sizeof(AppPath[0]));
(_tcsrchr(AppPath,'\\'))[1] = 0;
_tcscat( AppPath, _T("postfix.ini"));
if(!ReadPostfix(AppPath))
{
AfxMessageBox("Failed to read the config file:\n" + CString(AppPath) );
return -1;
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
BOOL ReadPostfix(TCHAR configfilename[])
{
TRY
{
CStdioFile reader( configfilename, CFile::modeRead | CFile::typeText );
CString lpszFilter;
CString strPostfix;
while(reader.ReadString(strPostfix))
{
strPostfix.TrimLeft();
strPostfix.TrimRight();
strPostfix.Remove('*');
strPostfix.Remove('.');
strPostfix = "*." + strPostfix;
lpszFilter += strPostfix + "|" + strPostfix + "|";
}
reader.Close();
if(lpszFilter == "")
return FALSE;
lpszFilter += "|";
CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY, lpszFilter, NULL);
if(dlg.DoModal() == IDOK)
{
ShellExecute(NULL, "open", dlg.GetPathName(), NULL, NULL, SW_SHOWNORMAL);
}
}
CATCH( CFileException, e )
{
return FALSE;
}
END_CATCH
return TRUE;
}
实用与学习软件系列(28) MyExplorer 可配置filter的资源管理器(含源码)
需积分: 9 126 浏览量
2008-10-14
00:37:55
上传
评论
收藏 9KB RAR 举报
wangfeiyao1983
- 粉丝: 3
- 资源: 39
最新资源
- KMP算法(Knuth-Morris-Pratt算法
- KMP算法(Knuth-Morris-Pratt算法
- shufflenet模型-python语言pytorch框架训练识别张嘴闭嘴-不含数据集图片-含逐行注释和说明文档.zip
- resnet模型-基于人工智能的卷积网络训练识别面部表情识别-不含数据集图片-含逐行注释和说明文档
- resnet模型-python语言pytorch框架训练识别香蕉品质-不含数据集图片-含逐行注释和说明文档.zip
- KMP算法(Knuth-Morris-Pratt算法
- mobilenet模型-python训练识别塑料制品分类-不含数据集图片-含逐行注释和说明文档.zip
- KMP算法(Knuth-Morris-Pratt算法
- mobilenet模型-CNN图像分类识别葡萄品级果-不含数据集图片-含逐行注释和说明文档.zip
- KMP算法(Knuth-Morris-Pratt算法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈