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.

91 lines
2.7 KiB

  1. /****************************************************************************\
  2. *
  3. * pleasdlg.h
  4. *
  5. * Created: William Taylor (wtaylor) 01/22/01
  6. *
  7. * MS Ratings Access Denied Dialog
  8. *
  9. \****************************************************************************/
  10. #ifndef PLEASE_DIALOG_H
  11. #define PLEASE_DIALOG_H
  12. #include "basedlg.h" // CBaseDialog
  13. const UINT MAX_CACHED_LABELS = 16;
  14. const UINT WM_NEWDIALOG = WM_USER + 1000;
  15. const DWORD PDD_DONE = 0x1;
  16. const DWORD PDD_ALLOW = 0x2;
  17. // $BUG - This should be placed in pleasdlg.cpp.
  18. const char szRatingsProp[] = "RatingsDialogHandleProp";
  19. const char szRatingsValue[] = "RatingsDialogHandleValue";
  20. struct PleaseDlgData
  21. {
  22. LPCSTR pszUsername;
  23. LPCSTR pszContentDescription;
  24. PicsUser *pPU;
  25. CParsedLabelList *pLabelList;
  26. HWND hwndDlg;
  27. HWND hwndOwner;
  28. DWORD dwFlags;
  29. HWND hwndEC;
  30. UINT cLabels;
  31. LPSTR apLabelStrings[MAX_CACHED_LABELS];
  32. };
  33. class CPleaseDialog: public CBaseDialog<CPleaseDialog>
  34. {
  35. private:
  36. static DWORD aIds[];
  37. static DWORD aPleaseIds[];
  38. PleaseDlgData * m_ppdd;
  39. public:
  40. enum { IDD = IDD_PLEASE };
  41. public:
  42. CPleaseDialog( PleaseDlgData * p_ppdd );
  43. public:
  44. typedef CPleaseDialog thisClass;
  45. typedef CBaseDialog<thisClass> baseClass;
  46. BEGIN_MSG_MAP(thisClass)
  47. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  48. COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
  49. COMMAND_ID_HANDLER(IDOK, OnOK)
  50. MESSAGE_HANDLER(WM_HELP, OnHelp)
  51. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu)
  52. MESSAGE_HANDLER(WM_NEWDIALOG, OnNewDialog)
  53. CHAIN_MSG_MAP(baseClass)
  54. END_MSG_MAP()
  55. protected:
  56. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  57. LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  58. LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  59. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  60. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  61. LRESULT OnNewDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  62. protected:
  63. void AppendString(HWND hwndEC, LPCSTR pszString);
  64. void AddSeparator(HWND hwndEC, BOOL fAppendToEnd);
  65. void InitPleaseDialog( PleaseDlgData * pdd );
  66. void EndPleaseDialog( BOOL fRet);
  67. HRESULT AddToApprovedSites( BOOL fAlwaysNever, BOOL fSitePage );
  68. protected:
  69. BOOL IsPleaseDialog( void ) { ASSERT( m_ppdd ); return ( m_ppdd ? m_ppdd->pPU->fPleaseMom : TRUE ); }
  70. BOOL IsDenyDialog( void ) { return ! IsPleaseDialog(); }
  71. };
  72. #endif