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.

95 lines
3.0 KiB

  1. #pragma once
  2. //#include "wmpresource.h"
  3. #include "resource.h"
  4. //#include "wmpcore.h"
  5. #include <commctrl.h>
  6. #include <wininet.h>
  7. class ATL_NO_VTABLE CFavoritesPropertyPage:
  8. public CComObjectRootEx<CComSingleThreadModel>,
  9. public CComCoClass<CFavoritesPropertyPage, &__uuidof(FavoritesPropPage)>,
  10. public CDialogImpl<CFavoritesPropertyPage>,
  11. public IPropertyPageImpl<CFavoritesPropertyPage>
  12. {
  13. public:
  14. CFavoritesPropertyPage();
  15. virtual ~CFavoritesPropertyPage();
  16. enum { IDD = IDD_CE_PROPPAGE_FAVORITES_FAVORITES };
  17. DECLARE_REGISTRY_RESOURCEID(IDR_CEWMDM_REG)
  18. BEGIN_COM_MAP(CFavoritesPropertyPage)
  19. COM_INTERFACE_ENTRY(IPropertyPage)
  20. END_COM_MAP()
  21. BEGIN_MSG_MAP(CFavoritesPropertyPage)
  22. NOTIFY_CODE_HANDLER(LVN_ITEMCHANGED, OnItemChanged)
  23. NOTIFY_CODE_HANDLER(LVN_ENDLABELEDIT, OnEndLabelEdit)
  24. NOTIFY_CODE_HANDLER(LVN_KEYDOWN, OnKeyDown)
  25. COMMAND_ID_HANDLER(IDC_CE_PROPPAGE_FAVORITES_ADD, OnAdd)
  26. COMMAND_ID_HANDLER(IDC_CE_PROPPAGE_FAVORITES_DELETE, OnDelete)
  27. CHAIN_MSG_MAP(IPropertyPageImpl<CFavoritesPropertyPage>)
  28. END_MSG_MAP()
  29. //
  30. // Message Handlers
  31. //
  32. LRESULT OnItemChanged(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  33. LRESULT OnEndLabelEdit(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  34. LRESULT OnKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  35. LRESULT OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  36. LRESULT OnDelete(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  37. //
  38. // IPropertyPage
  39. //
  40. STDMETHOD(Activate)(HWND hWndParent, LPCRECT pRect, BOOL bModal);
  41. STDMETHOD(Apply)();
  42. protected:
  43. HRESULT InitList();
  44. HRESULT EnableControls();
  45. HRESULT ManageFavorites( int iItem, BOOL fRemove );
  46. HRESULT ManageFavorites( LPWSTR pszURL, LPWSTR pszName, BOOL fRemove );
  47. HRESULT AddFavorite( LPWSTR pszURL, LPWSTR pszName, BOOL fDirty );
  48. void ShowError(HRESULT hrError);
  49. HWND m_hwndList;
  50. HANDLE m_hDb;
  51. BOOL m_fLeaveDBOpen;
  52. HCURSOR m_hCursorWait;
  53. };
  54. class CAddDialog:
  55. public CDialogImpl<CAddDialog>
  56. {
  57. public:
  58. CAddDialog();
  59. enum { IDD = IDD_CE_PROPPAGE_FAVORITES_ADD_FAVORITE};
  60. BEGIN_MSG_MAP(CAddDialog)
  61. COMMAND_ID_HANDLER(IDOK, OnOK)
  62. COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
  63. COMMAND_HANDLER(IDC_CE_PROPPAGE_FAVORITES_URL, EN_CHANGE, OnURLChange)
  64. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  65. END_MSG_MAP()
  66. //
  67. // Message Handlers
  68. //
  69. LRESULT OnURLChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  70. LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  71. LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  72. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  73. WCHAR m_wszURL[INTERNET_MAX_URL_LENGTH];
  74. WCHAR m_wszName[MAX_PATH];
  75. protected:
  76. void EnableControls();
  77. };