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.

120 lines
3.6 KiB

  1. // RatSrvPg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include <iadmw.h>
  5. #include "cnfgprts.h"
  6. #include "parserat.h"
  7. #include "RatData.h"
  8. #include "RatSrvPg.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CRatServicePage property page
  16. IMPLEMENT_DYNCREATE(CRatServicePage, CPropertyPage)
  17. CRatServicePage::CRatServicePage() : CPropertyPage(CRatServicePage::IDD)
  18. {
  19. //{{AFX_DATA_INIT(CRatServicePage)
  20. m_sz_description = _T("");
  21. //}}AFX_DATA_INIT
  22. }
  23. CRatServicePage::~CRatServicePage()
  24. {
  25. }
  26. void CRatServicePage::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CPropertyPage::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CRatServicePage)
  30. DDX_Text(pDX, IDC_DESCRIPTION, m_sz_description);
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CRatServicePage, CPropertyPage)
  34. //{{AFX_MSG_MAP(CRatServicePage)
  35. ON_BN_CLICKED(IDC_QUESTIONAIRE, OnQuestionaire)
  36. ON_BN_CLICKED(IDC_MOREINFO, OnMoreinfo)
  37. //}}AFX_MSG_MAP
  38. ON_COMMAND(ID_HELP_FINDER, DoHelp)
  39. ON_COMMAND(ID_HELP, DoHelp)
  40. ON_COMMAND(ID_CONTEXT_HELP, DoHelp)
  41. ON_COMMAND(ID_DEFAULT_HELP, DoHelp)
  42. END_MESSAGE_MAP()
  43. //---------------------------------------------------------------------------
  44. void CRatServicePage::DoHelp()
  45. {
  46. DebugTraceHelp(HIDD_RATINGS_SERVICE);
  47. WinHelp( HIDD_RATINGS_SERVICE );
  48. }
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CRatServicePage message handlers
  51. //--------------------------------------------------------------------------
  52. void CRatServicePage::OnQuestionaire()
  53. {
  54. // sometimes it takes a few moments of IE to get going
  55. CWaitCursor waitcursor;
  56. // get the URL of the ratings service place
  57. CString szURL;
  58. szURL.LoadString( IDS_RATING_URL );
  59. // launch IE with the URL of the ratings service place
  60. ShellExecute(
  61. NULL, // handle to parent window
  62. NULL, // pointer to string that specifies operation to perform
  63. szURL, // pointer to filename or folder name string
  64. NULL, // pointer to string that specifies executable-file parameters
  65. NULL, // pointer to string that specifies default directory
  66. SW_SHOW // whether file is shown when opened
  67. );
  68. }
  69. //--------------------------------------------------------------------------
  70. void CRatServicePage::OnMoreinfo()
  71. {
  72. // sometimes it takes a few moments of IE to get going
  73. CWaitCursor waitcursor;
  74. // if the string isn't there, fail
  75. if ( m_szMoreInfoURL.IsEmpty() )
  76. return;
  77. // go to the URL
  78. ShellExecute(
  79. NULL, // handle to parent window
  80. NULL, // pointer to string that specifies operation to perform
  81. m_szMoreInfoURL, // pointer to filename or folder name string
  82. NULL, // pointer to string that specifies executable-file parameters
  83. NULL, // pointer to string that specifies default directory
  84. SW_SHOW // whether file is shown when opened
  85. );
  86. }
  87. //--------------------------------------------------------------------------
  88. BOOL CRatServicePage::OnSetActive()
  89. {
  90. UpdateData( TRUE );
  91. // put the proper display string into place
  92. m_sz_description = m_pRatData->rgbRats[m_pRatData->iRat]->etstrDesc.Get();
  93. // get the more info URL too
  94. m_szMoreInfoURL = m_pRatData->rgbRats[m_pRatData->iRat]->etstrRatingService.Get();
  95. UpdateData( FALSE );
  96. return CPropertyPage::OnSetActive();
  97. }