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.

149 lines
4.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////
  23. // confprop.c - conference properties dialog box
  24. ////
  25. #include "winlocal.h"
  26. #include <commctrl.h>
  27. #include "confprop.h"
  28. #include "cpgen.h"
  29. #include "res.h"
  30. #include "confinfo.h"
  31. #include "DlgBase.h"
  32. #include "objsec.h"
  33. int CALLBACK ConfProp_PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam);
  34. // global to keep track of DLL's instance/module handle;
  35. //
  36. HINSTANCE g_hInstLib;
  37. ///////////////////////////////////////////////////////////////
  38. // ConfProp_Init
  39. //
  40. void ConfProp_Init( HINSTANCE hInst )
  41. {
  42. g_hInstLib = hInst;
  43. }
  44. ///////////////////////////////////////////////////////////////
  45. // ConfProp_DoModal
  46. //
  47. INT64 ConfProp_DoModal( HWND hWndOwner, CONFPROP& confprop )
  48. {
  49. INT64 nRet;
  50. HPROPSHEETPAGE hpsp[2];
  51. PROPSHEETPAGE psp;
  52. PROPSHEETHEADER psh;
  53. do
  54. {
  55. // fill out the PROPSHEETPAGE struct for the General sheet
  56. //
  57. psp.dwSize = sizeof(PROPSHEETPAGE);
  58. psp.dwFlags = PSP_USETITLE | PSP_HASHELP;
  59. psp.hInstance = g_hInstLib;
  60. psp.pszTemplate = MAKEINTRESOURCE(IDD_CONFPROP_GENERAL);
  61. psp.pszIcon = NULL;
  62. psp.pszTitle = MAKEINTRESOURCE(IDS_GENERAL);
  63. psp.pfnDlgProc = ConfPropGeneral_DlgProc;
  64. psp.lParam = (LPARAM) &confprop;
  65. psp.pfnCallback = NULL;
  66. psp.pcRefParent = NULL;
  67. hpsp[0] = CreatePropertySheetPage(&psp);
  68. CObjSecurity* pObjSecurity = new CObjSecurity;
  69. HRESULT hr = pObjSecurity->InternalInitialize( &confprop );
  70. hpsp[1] = CreateSecurityPage(pObjSecurity);
  71. // fill out the PROPSHEETHEADER
  72. //
  73. psh.dwSize = sizeof(PROPSHEETHEADER);
  74. psh.dwFlags = PSH_HASHELP | PSH_NOAPPLYNOW | PSH_USECALLBACK;
  75. psh.hwndParent = hWndOwner;
  76. psh.hInstance = g_hInstLib;
  77. psh.pszIcon = NULL;
  78. psh.pszCaption = MAKEINTRESOURCE(IDS_CONFPROP);
  79. psh.nPages = sizeof(hpsp) / sizeof(HPROPSHEETPAGE);
  80. psh.nStartPage = 0;
  81. psh.phpage = (HPROPSHEETPAGE*)&hpsp[0];
  82. psh.pfnCallback = ConfProp_PropSheetProc;
  83. // This is a loop so because the user has the option to cancel things from
  84. // the security property page. The program uses a flag (confprop.ConfInfo.WasSecuritySet())
  85. // to determine when the user has agreed to the security settings to continue.
  86. // display the modal property sheet
  87. nRet = PropertySheet( &psh );
  88. // Clean-up
  89. if( pObjSecurity )
  90. {
  91. pObjSecurity->Release();
  92. pObjSecurity = NULL;
  93. }
  94. if ( nRet == IDOK )
  95. {
  96. if ( confprop.ConfInfo.WasSecuritySet() )
  97. {
  98. // Repaint window before commit
  99. UpdateWindow( hWndOwner );
  100. DWORD dwError;
  101. if ( confprop.ConfInfo.CommitSecurity(dwError, confprop.ConfInfo.IsNewConference()) )
  102. {
  103. //get proper message
  104. UINT uId = IDS_CONFPROP_INVALIDTIME + dwError - 1;
  105. MessageBox(hWndOwner, String(g_hInstLib, uId), NULL, MB_OK | MB_ICONEXCLAMATION );
  106. }
  107. }
  108. else
  109. {
  110. nRet = IDRETRY;
  111. }
  112. }
  113. } while ( nRet == IDRETRY );
  114. return nRet;
  115. }
  116. ////
  117. // private
  118. ////
  119. int CALLBACK ConfProp_PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
  120. {
  121. switch (uMsg)
  122. {
  123. case PSCB_PRECREATE:
  124. break;
  125. case PSCB_INITIALIZED:
  126. ConvertPropSheetHelp( hwndDlg );
  127. break;
  128. }
  129. return 0;
  130. }