⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mypropertysheet.cpp

📁 文件加密的过滤驱动程序源代码.
💻 CPP
字号:
// MyPropertySheet.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"
#include "MyPropertySheet.h"

#include "..\HookShr\ComDef.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFileGuardPropertySheet

IMPLEMENT_DYNAMIC(CFileGuardPropertySheet, CPropertySheet)

CFileGuardPropertySheet::CFileGuardPropertySheet(CWnd* pWndParent)
	 : CPropertySheet(IDS_PROPSHT_CAPTION, pWndParent)
{
	m_psh.dwFlags |=PSH_NOAPPLYNOW;

	AddPage(&m_Page1);
	AddPage(&m_Page2);
}

CFileGuardPropertySheet::~CFileGuardPropertySheet()
{
}


BEGIN_MESSAGE_MAP(CFileGuardPropertySheet, CPropertySheet)
	//{{AFX_MSG_MAP(CFileGuardPropertySheet)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CFileGuardPropertySheet message handlers



void CFileGuardPropertySheet::SetPath(LPCTSTR lpszPath)
{
	m_Page1.m_strPath=lpszPath;
}

CString CFileGuardPropertySheet::GetPath()
{
	return m_Page1.m_strPath;
}

WORD CFileGuardPropertySheet::GetProtectionType()
{
	if( m_Page1.m_nAction!=1 )		//if "add" radio box is not selected...
		return 0;

	return (m_Page1.m_bDeleteProtection*PT_DELETE | m_Page1.m_bWriteProtection*PT_WRITE
		| m_Page1.m_bReadProtection*PT_READ | m_Page1.m_bHideFile*PT_HIDE);
}



void CFileGuardPropertySheet::SetProtectionType(WORD type)
{
	m_Page1.m_bDeleteProtection= type&PT_DELETE ? 1 : 0;
	m_Page1.m_bWriteProtection=type&PT_WRITE ? 1 : 0;
	m_Page1.m_bReadProtection=type&PT_READ ? 1 : 0;
	m_Page1.m_bHideFile=type&PT_HIDE? 1 : 0;

	//if(::IsWindow(m_Page1.m_hWnd))	
	//	m_Page1.UpdateData(FALSE);
}

⌨️ 快捷键说明

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