Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

263 lines
6.5 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1998.
  5. //
  6. // File: cause.cpp
  7. //
  8. // Contents: Digital Signitures property page
  9. //
  10. // Classes: CCause
  11. //
  12. // History: 07-10-2000 stevebl Created
  13. //
  14. //---------------------------------------------------------------------------
  15. #include "precomp.hxx"
  16. #include "wincrypt.h"
  17. #include "cryptui.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CCause property page
  25. IMPLEMENT_DYNCREATE(CCause, CPropertyPage)
  26. CCause::CCause() : CPropertyPage(CCause::IDD),
  27. m_fRemovedView(FALSE)
  28. {
  29. //{{AFX_DATA_INIT(CCause)
  30. // NOTE: the ClassWizard will add member initialization here
  31. //}}AFX_DATA_INIT
  32. }
  33. CCause::~CCause()
  34. {
  35. *m_ppThis = NULL;
  36. }
  37. void CCause::DoDataExchange(CDataExchange* pDX)
  38. {
  39. CPropertyPage::DoDataExchange(pDX);
  40. //{{AFX_DATA_MAP(CCause)
  41. //}}AFX_DATA_MAP
  42. }
  43. BEGIN_MESSAGE_MAP(CCause, CPropertyPage)
  44. //{{AFX_MSG_MAP(CCause)
  45. ON_WM_CONTEXTMENU()
  46. //}}AFX_MSG_MAP
  47. END_MESSAGE_MAP()
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CCause message handlers
  50. BOOL CCause::OnInitDialog()
  51. {
  52. CPropertyPage::OnInitDialog();
  53. RefreshData();
  54. return TRUE;
  55. }
  56. BOOL CCause::OnApply()
  57. {
  58. return CPropertyPage::OnApply();
  59. }
  60. LRESULT CCause::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
  61. {
  62. switch (message)
  63. {
  64. case WM_HELP:
  65. StandardHelp((HWND)((LPHELPINFO) lParam)->hItemHandle, IDD, TRUE);
  66. return 0;
  67. case WM_USER_REFRESH:
  68. RefreshData();
  69. return 0;
  70. case WM_USER_CLOSE:
  71. return GetOwner()->SendMessage(WM_CLOSE);
  72. default:
  73. return CPropertyPage::WindowProc(message, wParam, lParam);
  74. }
  75. }
  76. void CCause::RefreshData(void)
  77. {
  78. CString sz;
  79. CString szTemp;
  80. sz.LoadString(IDS_RSOP_APPLY);
  81. sz += TEXT("\r\n\r\n");
  82. switch (m_pData->m_dwApplyCause)
  83. {
  84. case 1:
  85. szTemp.LoadString(IDS_RSOP_AC1);
  86. break;
  87. case 2:
  88. szTemp.LoadString(IDS_RSOP_AC2);
  89. break;
  90. case 3:
  91. szTemp.LoadString(IDS_RSOP_AC3);
  92. break;
  93. case 4:
  94. szTemp.LoadString(IDS_RSOP_AC4);
  95. break;
  96. case 5:
  97. szTemp.LoadString(IDS_RSOP_AC5);
  98. break;
  99. case 6:
  100. szTemp.LoadString(IDS_RSOP_AC6);
  101. break;
  102. case 7:
  103. szTemp.LoadString(IDS_RSOP_AC7);
  104. break;
  105. case 8:
  106. szTemp.LoadString(IDS_RSOP_AC8);
  107. break;
  108. default:
  109. szTemp.LoadString(IDS_NODATA);
  110. }
  111. sz += szTemp;
  112. if (m_pData->m_dwApplyCause >= 1)
  113. {
  114. switch (m_pData->m_dwLanguageMatch)
  115. {
  116. case 1:
  117. szTemp.LoadString(IDS_RSOP_LM1);
  118. szTemp = TEXT("\r\n") + szTemp;
  119. break;
  120. case 2:
  121. szTemp.LoadString(IDS_RSOP_LM2);
  122. szTemp = TEXT("\r\n") + szTemp;
  123. break;
  124. case 3:
  125. szTemp.LoadString(IDS_RSOP_LM3);
  126. szTemp = TEXT("\r\n") + szTemp;
  127. break;
  128. case 4:
  129. szTemp.LoadString(IDS_RSOP_LM4);
  130. szTemp = TEXT("\r\n") + szTemp;
  131. break;
  132. case 5:
  133. szTemp.LoadString(IDS_RSOP_LM5);
  134. szTemp = TEXT("\r\n") + szTemp;
  135. break;
  136. default:
  137. szTemp = TEXT("");
  138. break;
  139. }
  140. sz += szTemp;
  141. switch (m_pData->m_dwApplyCause)
  142. {
  143. case 4:
  144. szTemp.Format(IDS_RSOP_EXTACT, m_pData->m_szOnDemandFileExtension);
  145. szTemp = TEXT("\r\n") + szTemp;
  146. break;
  147. case 5:
  148. szTemp.Format(IDS_RSOP_CLSIDACT, m_pData->m_szOnDemandClsid);
  149. szTemp = TEXT("\r\n") + szTemp;
  150. break;
  151. case 7:
  152. szTemp.Format(IDS_RSOP_PROGIDACT, m_pData->m_szOnDemandProgid);
  153. szTemp = TEXT("\r\n") + szTemp;
  154. break;
  155. default:
  156. szTemp = TEXT("");
  157. }
  158. sz += szTemp;
  159. }
  160. if (m_fRemovedView)
  161. {
  162. sz += TEXT("\r\n\r\n\r\n");
  163. szTemp.LoadString(IDS_RSOP_REMOVAL);
  164. sz += szTemp;
  165. sz += TEXT("\r\n\r\n");
  166. switch (m_pData->m_dwRemovalType)
  167. {
  168. case 2:
  169. szTemp.LoadString(IDS_RSOP_RT2);
  170. break;
  171. case 3:
  172. szTemp.LoadString(IDS_RSOP_RT3);
  173. break;
  174. case 4:
  175. szTemp.LoadString(IDS_RSOP_RT4);
  176. break;
  177. default:
  178. szTemp.LoadString(IDS_NODATA);
  179. }
  180. sz += szTemp;
  181. if (m_pData->m_dwRemovalType >= 2 && m_pData->m_dwRemovalType <= 4)
  182. {
  183. switch (m_pData->m_dwRemovalCause)
  184. {
  185. case 2:
  186. {
  187. szTemp.Format(IDS_RSOP_RC2, m_pData->m_szRemovingApplicationName);
  188. szTemp = TEXT("\r\n") + szTemp;
  189. }
  190. break;
  191. case 3:
  192. szTemp.LoadString(IDS_RSOP_RC3);
  193. szTemp = TEXT("\r\n") + szTemp;
  194. break;
  195. case 4:
  196. szTemp.LoadString(IDS_RSOP_RC4);
  197. szTemp = TEXT("\r\n") + szTemp;
  198. break;
  199. case 5:
  200. szTemp.LoadString(IDS_RSOP_RC5);
  201. szTemp = TEXT("\r\n") + szTemp;
  202. break;
  203. case 6:
  204. szTemp.Format(IDS_RSOP_RC6, m_pData->m_szRemovingApplicationName);
  205. szTemp = TEXT("\r\n") + szTemp;
  206. break;
  207. case 7:
  208. szTemp.Format(IDS_RSOP_RC7, m_pData->m_szRemovingApplicationName);
  209. szTemp = TEXT("\r\n") + szTemp;
  210. break;
  211. case 8:
  212. szTemp.LoadString(IDS_RSOP_RC8);
  213. szTemp = TEXT("\r\n") + szTemp;
  214. break;
  215. default:
  216. szTemp = TEXT("");
  217. }
  218. sz += szTemp;
  219. }
  220. }
  221. CEdit * pEd = (CEdit *) GetDlgItem(IDC_EDIT1);
  222. pEd->Clear();
  223. pEd->ReplaceSel(sz);
  224. SetModified(FALSE);
  225. }
  226. void CCause::OnContextMenu(CWnd* pWnd, CPoint point)
  227. {
  228. StandardContextMenu(pWnd->m_hWnd, IDD_RSOPCAUSE, TRUE);
  229. }