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.

70 lines
2.1 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to
  4. // existing Microsoft documentation.
  5. //
  6. //
  7. //
  8. //
  9. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  10. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  11. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  12. // PURPOSE.
  13. //
  14. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  15. //
  16. //
  17. //
  18. //==============================================================;
  19. #include "DeleBase.h"
  20. #include "Comp.h"
  21. #include "CompData.h"
  22. const GUID CDelegationBase::thisGuid = { 0x2974380b, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
  23. HBITMAP CDelegationBase::m_pBMapSm = NULL;
  24. HBITMAP CDelegationBase::m_pBMapLg = NULL;
  25. //==============================================================
  26. //
  27. // CDelegationBase implementation
  28. //
  29. //
  30. CDelegationBase::CDelegationBase()
  31. : bExpanded(FALSE)
  32. {
  33. if (NULL == m_pBMapSm || NULL == m_pBMapLg)
  34. LoadBitmaps();
  35. }
  36. CDelegationBase::~CDelegationBase()
  37. {
  38. }
  39. // CDelegationBase::AddImages sets up the collection of images to be displayed
  40. // by the IComponent in the result pane as a result of its MMCN_SHOW handler
  41. HRESULT CDelegationBase::OnAddImages(IImageList *pImageList, HSCOPEITEM hsi)
  42. {
  43. return pImageList->ImageListSetStrip((long *)m_pBMapSm, // pointer to a handle
  44. (long *)m_pBMapLg, // pointer to a handle
  45. 0, // index of the first image in the strip
  46. RGB(0, 128, 128) // color of the icon mask
  47. );
  48. }
  49. HRESULT CDelegationBase::OnShowContextHelp(IDisplayHelp *m_ipDisplayHelp, LPOLESTR helpFile)
  50. {
  51. WCHAR topicName[MAX_PATH];
  52. wcscpy(topicName, helpFile);
  53. // we should read this from a resource file
  54. wcscat(topicName, L"::/default.htm");
  55. LPOLESTR pszTopic = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(topicName) + 1) * sizeof(WCHAR)));
  56. wcscpy(pszTopic, topicName);
  57. return m_ipDisplayHelp->ShowTopic(pszTopic);
  58. }