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.

111 lines
3.1 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // proxyext.cpp
  8. //
  9. // SYNOPSIS
  10. //
  11. // Defines the class ProxyExtension
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 02/19/2000 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #include <proxypch.h>
  19. #include <proxyext.h>
  20. #include <proxynode.h>
  21. // The GUID of the node we're going to extend.
  22. class __declspec(uuid("02BBE102-6C29-11d1-9563-0060B0576642")) IASNode;
  23. ProxyExtension::ProxyExtension() throw ()
  24. : moveUp(IDS_POLICY_MOVE_UP), moveDown(IDS_POLICY_MOVE_DOWN)
  25. {
  26. buttons[0].nBitmap = 0;
  27. buttons[0].idCommand = 0;
  28. buttons[0].fsState = TBSTATE_ENABLED;
  29. buttons[0].fsType = TBSTYLE_BUTTON;
  30. buttons[0].lpButtonText = L"";
  31. buttons[0].lpTooltipText = moveUp;
  32. buttons[1].nBitmap = 1;
  33. buttons[1].idCommand = 1;
  34. buttons[1].fsState = TBSTATE_ENABLED;
  35. buttons[1].fsType = TBSTYLE_BUTTON;
  36. buttons[1].lpButtonText = L"";
  37. buttons[1].lpTooltipText = moveDown;
  38. toolbars[0].nImages = 2;
  39. toolbars[0].hbmp = LoadBitmap(
  40. _Module.GetResourceInstance(),
  41. MAKEINTRESOURCE(IDB_PROXY_TOOLBAR)
  42. );
  43. toolbars[0].crMask = RGB(255, 0, 255);
  44. toolbars[0].nButtons = 2;
  45. toolbars[0].lpButtons = buttons;
  46. memset(toolbars + 1, 0, sizeof(toolbars[1]));
  47. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  48. AfxInitRichEdit();
  49. }
  50. ProxyExtension::~ProxyExtension() throw ()
  51. { }
  52. const SnapInToolbarDef* ProxyExtension::getToolbars() const throw ()
  53. { return toolbars; }
  54. STDMETHODIMP ProxyExtension::Initialize(LPUNKNOWN pUnknown)
  55. {
  56. try
  57. {
  58. // Let our base class initialize.
  59. CheckError(SnapInView::Initialize(pUnknown));
  60. // Install the scope pane icons.
  61. setImageStrip(IDB_PROXY_SMALL_ICONS, IDB_PROXY_LARGE_ICONS, TRUE);
  62. }
  63. CATCH_AND_RETURN();
  64. return S_OK;
  65. }
  66. STDMETHODIMP ProxyExtension::Notify(
  67. LPDATAOBJECT lpDataObject,
  68. MMC_NOTIFY_TYPE event,
  69. LPARAM arg,
  70. LPARAM param
  71. )
  72. {
  73. // We only have to do something special if we're expanding and we haven't
  74. // created the Proxy node yet.
  75. if (event == MMCN_EXPAND && arg && !node)
  76. {
  77. // Is this the main IAS node ?
  78. GUID guid;
  79. ExtractNodeType(lpDataObject, &guid);
  80. if (guid == __uuidof(IASNode))
  81. {
  82. try
  83. {
  84. node = new (AfxThrow) ProxyNode(
  85. *this,
  86. lpDataObject,
  87. (HSCOPEITEM)param
  88. );
  89. }
  90. CATCH_AND_RETURN();
  91. return S_OK;
  92. }
  93. }
  94. // For everything else we delegate to our base class.
  95. return SnapInView::Notify(lpDataObject, event, arg, param);
  96. }