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.

59 lines
1.5 KiB

  1. /****************************************************************************\
  2. *
  3. * toffdlg.cpp
  4. *
  5. * Created: William Taylor (wtaylor) 01/22/01
  6. *
  7. * MS Ratings Turn Off Ratings Dialog
  8. *
  9. \****************************************************************************/
  10. #include "msrating.h"
  11. #include "mslubase.h"
  12. #include "toffdlg.h" // CTurnOffDialog
  13. #include "debug.h"
  14. CTurnOffDialog::CTurnOffDialog()
  15. {
  16. // Add construction here...
  17. }
  18. LRESULT CTurnOffDialog::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  19. {
  20. SendDlgItemMessage(IDC_ADVISOR_OFF_CHECK,BM_SETCHECK,(WPARAM) BST_UNCHECKED,(LPARAM) 0);
  21. bHandled = FALSE;
  22. return 1L; // Let the system set the focus
  23. }
  24. LRESULT CTurnOffDialog::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  25. {
  26. if(BST_CHECKED==SendDlgItemMessage(IDC_ADVISOR_OFF_CHECK,
  27. BM_GETCHECK,
  28. (WPARAM) 0,
  29. (LPARAM) 0))
  30. {
  31. HKEY hkeyRating;
  32. hkeyRating = CreateRegKeyNT(::szRATINGS);
  33. if ( hkeyRating != NULL )
  34. {
  35. CRegKey key;
  36. key.Attach( hkeyRating );
  37. DWORD dwTurnOff=1;
  38. key.SetValue( dwTurnOff, szTURNOFF );
  39. }
  40. else
  41. {
  42. TraceMsg( TF_ERROR, "CTurnOffDialog::OnOK() - Failed to Create Ratings Registry Key!" );
  43. }
  44. }
  45. EndDialog(TRUE);
  46. return 0L;
  47. }