📄 hfilefactory.cpp
字号:
// HFileFactory.cpp: implementation of the CHFileFactory class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resourceeditor.h"
#include "HFileFactory.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CHFileFactory::CHFileFactory()
{
}
CHFileFactory::~CHFileFactory()
{
}
BOOL CHFileFactory::IsCoverFile( LPCTSTR pszFileName )
{
_ASSERTE( pszFileName != NULL );
WIN32_FIND_DATA wfd;
HANDLE hFind = ::FindFirstFile(pszFileName, &wfd);
if( hFind == INVALID_HANDLE_VALUE )
{
return TRUE;
}
else
{
FindClose(hFind);
CString strMsg;
strMsg.Format(_T("File \"%s\" already exist! would you like to cover it?"), pszFileName);
if( AfxMessageBox(strMsg, MB_YESNO) == IDNO )
return FALSE;
DWORD dwAttr = wfd.dwFileAttributes;
if( dwAttr & FILE_ATTRIBUTE_READONLY )
::SetFileAttributes(pszFileName, dwAttr &~ FILE_ATTRIBUTE_READONLY);
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -