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.

231 lines
6.0 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : ppFaxInboundRoutingMethodGeneral.cpp //
  3. // //
  4. // DESCRIPTION : prop pages of Inbox archive //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Dec 15 1999 yossg Created //
  10. // //
  11. // Copyright (C) 1999 Microsoft Corporation All Rights Reserved //
  12. // //
  13. /////////////////////////////////////////////////////////////////////////////
  14. #include "stdafx.h"
  15. #include "MSFxsSnp.h"
  16. #include "ppFaxInboundRoutingMethodGeneral.h"
  17. #include "FaxMMCGlobals.h"
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22. //
  23. // Constructor
  24. //
  25. CppFaxInboundRoutingMethod::CppFaxInboundRoutingMethod(
  26. LONG_PTR hNotificationHandle,
  27. CSnapInItem *pNode,
  28. BOOL bOwnsNotificationHandle,
  29. HINSTANCE hInst)
  30. : CPropertyPageExImpl<CppFaxInboundRoutingMethod>(pNode, NULL)
  31. {
  32. m_pParentNode = NULL; //in case static-cast failed and wont change the pointer
  33. m_pParentNode = static_cast <CFaxInboundRoutingMethodNode *> (pNode);
  34. m_lpNotifyHandle = hNotificationHandle;
  35. }
  36. //
  37. // Destructor
  38. //
  39. CppFaxInboundRoutingMethod::~CppFaxInboundRoutingMethod()
  40. {
  41. // Note - This needs to be called only once per property sheet.
  42. // In our convention called in the general tab.
  43. if (NULL != m_lpNotifyHandle)
  44. {
  45. MMCFreeNotifyHandle(m_lpNotifyHandle);
  46. m_lpNotifyHandle = NULL;
  47. }
  48. }
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CppFaxInboundRoutingMethod message handlers
  51. /*
  52. - CppFaxInboundRoutingMethod::OnInitDialog
  53. -
  54. * Purpose:
  55. * Initiates all controls when dialog is called.
  56. *
  57. * Arguments:
  58. *
  59. * Return:
  60. *
  61. */
  62. LRESULT CppFaxInboundRoutingMethod::OnInitDialog( UINT uiMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled )
  63. {
  64. DEBUG_FUNCTION_NAME( _T("CppFaxInboundRoutingMethod::PageInitDialog"));
  65. UNREFERENCED_PARAMETER( uiMsg );
  66. UNREFERENCED_PARAMETER( wParam );
  67. UNREFERENCED_PARAMETER( lParam );
  68. UNREFERENCED_PARAMETER( fHandled );
  69. ATLASSERT(NULL != m_pParentNode);
  70. //
  71. // Name
  72. //
  73. SetDlgItemText(IDC_INMETHOD_NAME_STATIC,
  74. m_pParentNode->GetName());
  75. //
  76. // Status
  77. //
  78. UINT uiIDS = ( m_pParentNode->GetStatus() ? IDS_INMETHOD_ENABLE : IDS_INMETHOD_DISABLE);
  79. if ( !m_buf.LoadString(_Module.GetResourceInstance(), uiIDS) )
  80. {
  81. DebugPrintEx(
  82. DEBUG_ERR,
  83. TEXT("Fail to load string for status value."));
  84. //can not do nothing more here!
  85. }
  86. else
  87. {
  88. SetDlgItemText(IDC_INMETHOD_STATUS_STATIC, m_buf);
  89. }
  90. //
  91. // Extension
  92. //
  93. SetDlgItemText(IDC_INMETHOD_EXTENSION_STATIC,
  94. m_pParentNode->GetExtensionName());
  95. return (1);
  96. }
  97. /*
  98. - CppFaxInboundRoutingMethod::SetProps
  99. -
  100. * Purpose:
  101. * Sets properties on apply.
  102. *
  103. * Arguments:
  104. * pCtrlFocus - focus pointer (int)
  105. *
  106. * Return:
  107. * OLE error code
  108. */
  109. HRESULT CppFaxInboundRoutingMethod::SetProps(int *pCtrlFocus)
  110. {
  111. DEBUG_FUNCTION_NAME( _T("CppFaxInboundRoutingMethod::SetProps"));
  112. return (S_OK);
  113. }
  114. /*
  115. - CppFaxInboundRoutingMethod::PreApply
  116. -
  117. * Purpose:
  118. * Checks properties before apply.
  119. *
  120. * Arguments:
  121. *
  122. * Return:
  123. * OLE error code
  124. */
  125. HRESULT CppFaxInboundRoutingMethod::PreApply(int *pCtrlFocus)
  126. {
  127. DEBUG_FUNCTION_NAME( _T("CppFaxInboundRoutingMethod::PreApply"));
  128. return(S_OK);
  129. }
  130. /*
  131. - CppFaxInboundRoutingMethod::OnApply
  132. -
  133. * Purpose:
  134. * Calls PreApply and SetProp to Apply changes.
  135. *
  136. * Arguments:
  137. *
  138. * Return:
  139. * TRUE or FALSE
  140. */
  141. BOOL CppFaxInboundRoutingMethod::OnApply()
  142. {
  143. return TRUE;
  144. }
  145. /*
  146. - CppFaxInboundRoutingMethod::SetApplyButton
  147. -
  148. * Purpose:
  149. * set Apply buttom modified.
  150. *
  151. * Arguments:
  152. *
  153. * Return:
  154. * 1
  155. */
  156. LRESULT CppFaxInboundRoutingMethod::SetApplyButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  157. {
  158. SetModified(TRUE);
  159. bHandled = TRUE;
  160. return(1);
  161. }
  162. //////////////////////////////////////////////////////////////////////////////
  163. /*++
  164. CppFaxInboundRoutingMethod::OnHelpRequest
  165. This is called in response to the WM_HELP Notify
  166. message and to the WM_CONTEXTMENU Notify message.
  167. WM_HELP Notify message.
  168. This message is sent when the user presses F1 or <Shift>-F1
  169. over an item or when the user clicks on the ? icon and then
  170. presses the mouse over an item.
  171. WM_CONTEXTMENU Notify message.
  172. This message is sent when the user right clicks over an item
  173. and then clicks "What's this?"
  174. --*/
  175. /////////////////////////////////////////////////////////////////////////////
  176. LRESULT
  177. CppFaxInboundRoutingMethod::OnHelpRequest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
  178. {
  179. DEBUG_FUNCTION_NAME(_T("CppFaxInboundRoutingMethod::OnHelpRequest"));
  180. switch (uMsg)
  181. {
  182. case WM_HELP:
  183. WinContextHelp(((LPHELPINFO)lParam)->dwContextId, m_hWnd);
  184. break;
  185. case WM_CONTEXTMENU:
  186. WinContextHelp(::GetWindowContextHelpId((HWND)wParam), m_hWnd);
  187. break;
  188. }
  189. return TRUE;
  190. }
  191. /////////////////////////////////////////////////////////////////////////////