Source code of Windows XP (NT5)
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.

119 lines
3.4 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. WinHelp( HIDD_RATINGS_SERVICE );
  47. }
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CRatServicePage message handlers
  50. //--------------------------------------------------------------------------
  51. void CRatServicePage::OnQuestionaire()
  52. {
  53. // sometimes it takes a few moments of IE to get going
  54. CWaitCursor waitcursor;
  55. // get the URL of the ratings service place
  56. CString szURL;
  57. szURL.LoadString( IDS_RATING_URL );
  58. // launch IE with the URL of the ratings service place
  59. ShellExecute(
  60. NULL, // handle to parent window
  61. NULL, // pointer to string that specifies operation to perform
  62. szURL, // pointer to filename or folder name string
  63. NULL, // pointer to string that specifies executable-file parameters
  64. NULL, // pointer to string that specifies default directory
  65. SW_SHOW // whether file is shown when opened
  66. );
  67. }
  68. //--------------------------------------------------------------------------
  69. void CRatServicePage::OnMoreinfo()
  70. {
  71. // sometimes it takes a few moments of IE to get going
  72. CWaitCursor waitcursor;
  73. // if the string isn't there, fail
  74. if ( m_szMoreInfoURL.IsEmpty() )
  75. return;
  76. // go to the URL
  77. ShellExecute(
  78. NULL, // handle to parent window
  79. NULL, // pointer to string that specifies operation to perform
  80. m_szMoreInfoURL, // pointer to filename or folder name string
  81. NULL, // pointer to string that specifies executable-file parameters
  82. NULL, // pointer to string that specifies default directory
  83. SW_SHOW // whether file is shown when opened
  84. );
  85. }
  86. //--------------------------------------------------------------------------
  87. BOOL CRatServicePage::OnSetActive()
  88. {
  89. UpdateData( TRUE );
  90. // put the proper display string into place
  91. m_sz_description = m_pRatData->rgbRats[m_pRatData->iRat]->etstrDesc.Get();
  92. // get the more info URL too
  93. m_szMoreInfoURL = m_pRatData->rgbRats[m_pRatData->iRat]->etstrRatingService.Get();
  94. UpdateData( FALSE );
  95. return CPropertyPage::OnSetActive();
  96. }