// 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); } }