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.

83 lines
2.3 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to existing Microsoft documentation.
  4. //
  5. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  6. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  7. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  8. // PURPOSE.
  9. //
  10. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  11. //==============================================================;
  12. #include "stdafx.h"
  13. #include <stdio.h>
  14. #include "node1.h"
  15. const GUID CNode1::thisGuid = { 0x28d4f536, 0xbdb5, 0x4bc5, {0xba, 0x88, 0x53, 0x75, 0xa4, 0x99, 0x68, 0x50} };
  16. //==============================================================
  17. //
  18. // CNode1 implementation
  19. //
  20. //
  21. CNode1::CNode1(int i, const _TCHAR *pszName) : id(i)
  22. {
  23. _tcscpy(m_szMachineName, pszName);
  24. }
  25. const _TCHAR *CNode1::GetDisplayName(int nCol)
  26. {
  27. static _TCHAR buf[128];
  28. _stprintf(buf, _T("MMC SDK Sample"));
  29. return buf;
  30. }
  31. HRESULT CNode1::OnShow(IConsole *pConsole, BOOL bShow, HSCOPEITEM scopeitem)
  32. {
  33. HRESULT hr;
  34. IUnknown *pUnk = NULL;
  35. IMessageView *pMessageView = NULL;
  36. hr = pConsole->QueryResultView(&pUnk);
  37. if (SUCCEEDED(hr)) {
  38. hr = pUnk->QueryInterface(IID_IMessageView, (void **)&pMessageView);
  39. if (SUCCEEDED(hr)) {
  40. pMessageView->SetIcon(Icon_Information);
  41. pMessageView->SetTitleText(L"ATL-based extension snap-in sample");
  42. pMessageView->SetBodyText(L"This sample allows you to start and stop the \n"
  43. L"Alerter service (if installed) on a local or remote machine.\n"
  44. L"\nTo modify the status of the service, use the context menu \n"
  45. L"of the 'MMC SDK Sample' node inserted by this sample.\n"
  46. L"\nTo see the actual status of the service, go to the \n"
  47. L"Services and Applications->Services node.");
  48. pMessageView->Release();
  49. }
  50. pUnk->Release();
  51. }
  52. return S_FALSE;
  53. }
  54. HRESULT CNode1::GetResultViewType(LPOLESTR *ppViewType, long *pViewOptions)
  55. {
  56. // message view control
  57. LPOLESTR lpOleStr = NULL;
  58. HRESULT hr = StringFromCLSID(CLSID_MessageView, &lpOleStr);
  59. *ppViewType = lpOleStr;
  60. // don't just list view menu items
  61. *pViewOptions = MMC_VIEW_OPTIONS_NOLISTVIEWS;
  62. return hr;
  63. }