Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CProfileInformationPage Class Reference

#include <profinfo.h>

Inheritance diagram for CProfileInformationPage:

CShellExtensionPage CPropertyPage List of all members.

Public Member Functions

 CProfileInformationPage (HINSTANCE hiWhere, LPCTSTR lpstrTarget)
 ~CProfileInformationPage ()
virtual BOOL OnInit ()
virtual BOOL OnDestroy ()

Private Attributes

CString m_csProfile
CProfilem_pcpTarget

Constructor & Destructor Documentation

CProfileInformationPage::CProfileInformationPage HINSTANCE  hiWhere,
LPCTSTR  lpstrTarget
 

Definition at line 30 of file profinfo.cpp.

References CProfileInformationPage(), m_csProfile, m_pcpTarget, NULL, ProfilePropertyPage, and ProfilePropertyString.

Referenced by CProfileInformationPage().

00031 { 00032 m_pcpTarget = NULL; 00033 m_csProfile = lpstrTarget; 00034 m_psp.dwSize = sizeof m_psp; 00035 m_psp.dwFlags |= PSP_USETITLE; 00036 m_psp.hInstance = hiWhere; 00037 m_psp.pszTemplate = MAKEINTRESOURCE(ProfilePropertyPage); 00038 m_psp.pszTitle = MAKEINTRESOURCE(ProfilePropertyString); 00039 }

CProfileInformationPage::~CProfileInformationPage  ) 
 

Definition at line 43 of file profinfo.cpp.

References m_pcpTarget.

00043 { 00044 if (m_pcpTarget) { 00045 delete m_pcpTarget; 00046 } 00047 }


Member Function Documentation

BOOL CProfileInformationPage::OnDestroy  )  [virtual]
 

Reimplemented from CPropertyPage.

Definition at line 163 of file profinfo.cpp.

References BOOL, FALSE, m_pcpTarget, and NULL.

00163 { 00164 00165 if (m_pcpTarget) { 00166 delete m_pcpTarget; 00167 m_pcpTarget = (CProfile *) NULL; 00168 } 00169 00170 return FALSE; // still need to handle this message by def. proc. 00171 }

BOOL CProfileInformationPage::OnInit  )  [virtual]
 

Reimplemented from CPropertyPage.

Definition at line 51 of file profinfo.cpp.

References AdditionalProfileInfo, BOOL, CMMDescription, CMMIcon, DWORD, FALSE, CProfile::GetCMM(), CString::Load(), m_csProfile, m_pcpTarget, MAX_PATH, NoAdditionalInfo, NULL, ProfileDescription, ProfileProducerInfo, sacDefaultCMM, SendDlgItemMessage(), SetDlgItemText(), CProfile::TagContents(), and TRUE.

00051 { 00052 00053 m_pcpTarget = new CProfile(m_csProfile); 00054 00055 if (m_pcpTarget) { 00056 00057 // Retrieve the 'desc' key, and put it in the description field 00058 SetDlgItemTextA(m_hwnd, ProfileDescription, 00059 m_pcpTarget->TagContents('desc', 4)); 00060 00061 // Get the copyright info from the 'cprt' tag 00062 SetDlgItemTextA(m_hwnd, ProfileProducerInfo, 00063 m_pcpTarget->TagContents('cprt')); 00064 00065 // Get the profile info from the 'vued' tag, not 'K007' tag 00066 LPCSTR lpAdditionalInfo = m_pcpTarget->TagContents('vued',4); 00067 00068 if (lpAdditionalInfo) { 00069 SetDlgItemTextA(m_hwnd, AdditionalProfileInfo, lpAdditionalInfo); 00070 } else { 00071 CString csNoAdditionalInfo; 00072 csNoAdditionalInfo.Load(NoAdditionalInfo); 00073 SetDlgItemTextA(m_hwnd, AdditionalProfileInfo, (LPCSTR)csNoAdditionalInfo); 00074 } 00075 00076 // Set the CMM description and bitmap- these are supposed 00077 // to come from the CMM. 00078 00079 // Get the CMM Name- this must be in char form 00080 00081 union { 00082 char acCMM[5]; 00083 DWORD dwCMM; 00084 }; 00085 00086 dwCMM = m_pcpTarget->GetCMM(); 00087 acCMM[4] = '\0'; 00088 00089 // Use it to form a key into the ICM registry. If we find it, get 00090 // the CMM name. If we don't, then use the default CMM name (icm32) 00091 00092 #ifdef UNICODE 00093 CString csKey = 00094 CString(_TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\ICM\\")) + 00095 (LPCTSTR) CString(acCMM); 00096 #else 00097 CString csKey = 00098 CString(_TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\ICM\\")) + 00099 (LPCTSTR) CString(acCMM); 00100 #endif 00101 00102 HKEY hkCMM; 00103 00104 if (ERROR_SUCCESS == RegOpenKey(HKEY_LOCAL_MACHINE, csKey, &hkCMM)) { 00105 TCHAR acValue[MAX_PATH]; 00106 00107 dwCMM = MAX_PATH; 00108 00109 if (ERROR_SUCCESS == RegEnumValue(hkCMM, 0, acValue, &dwCMM, NULL, 00110 NULL, NULL, NULL)) 00111 csKey = acValue; 00112 else 00113 csKey = sacDefaultCMM; 00114 00115 RegCloseKey(hkCMM); 00116 } 00117 else 00118 csKey = sacDefaultCMM; 00119 00120 // See if we can get an instance handle for the DLL... 00121 00122 HINSTANCE hi = LoadLibrary(csKey); 00123 00124 if (!hi) 00125 return TRUE; // Nothing to do, here, let the defaults prevail. 00126 00127 // Get description and icon identifier from CMS dll 00128 00129 DWORD dwCMMIcon = 0, dwCMMDescription = 0; 00130 00131 typedef BOOL (*FPCMGETINFO)(DWORD); 00132 00133 FPCMGETINFO fpCMGetInfo; 00134 00135 fpCMGetInfo = (FPCMGETINFO) GetProcAddress(hi,"CMGetInfo"); 00136 00137 if (fpCMGetInfo) { 00138 00139 dwCMMIcon = (*fpCMGetInfo)(CMM_LOGOICON); 00140 dwCMMDescription = (*fpCMGetInfo)(CMM_DESCRIPTION); 00141 00142 if (dwCMMDescription) { 00143 // Write the description, if there is one. 00144 csKey.Load(dwCMMDescription, hi); 00145 if ((LPCTSTR) csKey) 00146 SetDlgItemText(m_hwnd, CMMDescription, csKey); 00147 } 00148 00149 if (dwCMMIcon) { 00150 // Change/Create the Icon, if there is one. 00151 HICON hiCMM = LoadIcon(hi, MAKEINTRESOURCE(dwCMMIcon)); 00152 if (hiCMM) 00153 SendDlgItemMessage(m_hwnd, CMMIcon, STM_SETICON, (WPARAM) hiCMM, 0); 00154 } 00155 } 00156 00157 return TRUE; 00158 } else { 00159 return FALSE; 00160 } 00161 }


Member Data Documentation

CString CProfileInformationPage::m_csProfile [private]
 

Definition at line 24 of file profinfo.h.

Referenced by CProfileInformationPage(), and OnInit().

CProfile* CProfileInformationPage::m_pcpTarget [private]
 

Definition at line 25 of file profinfo.h.

Referenced by CProfileInformationPage(), OnDestroy(), OnInit(), and ~CProfileInformationPage().


The documentation for this class was generated from the following files:
Generated on Sat May 15 19:46:27 2004 for test by doxygen 1.3.7