diff options
Diffstat (limited to 'NSCmpts/EncryptAdvancedProp.cpp')
| -rw-r--r-- | NSCmpts/EncryptAdvancedProp.cpp | 51 | 
1 files changed, 51 insertions, 0 deletions
| diff --git a/NSCmpts/EncryptAdvancedProp.cpp b/NSCmpts/EncryptAdvancedProp.cpp new file mode 100644 index 0000000..2149139 --- /dev/null +++ b/NSCmpts/EncryptAdvancedProp.cpp @@ -0,0 +1,51 @@ +// EncryptAdvancedProp.cpp : Implementation of CEncryptAdvancedProp +#include "stdafx.h" +#include "NSCmpts.h" +#include "EncryptAdvancedProp.h" + +///////////////////////////////////////////////////////////////////////////// +// CEncryptAdvancedProp + +LRESULT CEncryptAdvancedProp::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ +	// Let it choose an object for data +	m_Data.Initialize(m_nObjects, m_ppUnk); + +	// Set this for CIgnoreProp +	m_hwndIgnore = m_hWnd; + +	CIgnoreProp::OnInitDialog(uMsg, wParam, lParam, bHandled); + +	// Other Data Init +	m_bDisablePassword = m_Data.GetInt(NS_ENCRYPT_REG_DISABLE, true) ? true : false; +	m_bEncryptReadOnly = m_Data.GetInt(NS_ENCRYPT_REG_READONLY, false) ? true : false; + +	UpdateData(false); + +	bHandled = true; +	return TRUE; +} + +LRESULT CEncryptAdvancedProp::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ +	// Just in case, save before destroy +	UpdateData(true); +	return 0;  +} + +void CEncryptAdvancedProp::UpdateData(bool bSave)  +{ +	// Do Ignore Extensions first +	CIgnoreProp::UpdateData(bSave); + +	if(bSave) +	{ +		m_bDisablePassword = IsDlgButtonChecked(IDC_DISABLEPASSWORD) ? true : false; +		m_bEncryptReadOnly = IsDlgButtonChecked(IDC_ENCRYPTREADONLY) ? true : false; +	} +	else +	{ +		CheckDlgButton(IDC_DISABLEPASSWORD, m_bDisablePassword ? BST_CHECKED : BST_UNCHECKED); +		CheckDlgButton(IDC_ENCRYPTREADONLY, m_bEncryptReadOnly ? BST_CHECKED : BST_UNCHECKED); +	} +} | 
