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.

67 lines
1.9 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 "Land.h"
  20. const GUID CLandBasedVehicle::thisGuid = { 0x2974380e, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
  21. //==============================================================
  22. //
  23. // CLandBasedVehicle implementation
  24. //
  25. //
  26. HRESULT CLandBasedVehicle::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed)
  27. {
  28. HRESULT hr = S_OK;
  29. CONTEXTMENUITEM menuItemsNew[] =
  30. {
  31. {
  32. L"Land based", L"Add a new land based vehicle",
  33. IDM_NEW_LAND, CCM_INSERTIONPOINTID_PRIMARY_NEW, 0, CCM_SPECIAL_DEFAULT_ITEM
  34. },
  35. { NULL, NULL, 0, 0, 0 }
  36. };
  37. // Loop through and add each of the menu items
  38. if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_NEW)
  39. {
  40. for (LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++)
  41. {
  42. hr = pContextMenuCallback->AddItem(m);
  43. if (FAILED(hr))
  44. break;
  45. }
  46. }
  47. return hr;
  48. }
  49. HRESULT CLandBasedVehicle::OnMenuCommand(IConsole *pConsole, long lCommandID)
  50. {
  51. switch (lCommandID)
  52. {
  53. case IDM_NEW_LAND:
  54. pConsole->MessageBox(L"This sample does not create a new item\nSee Complete sample for a demonstration", L"Menu Command", MB_OK|MB_ICONINFORMATION, NULL);
  55. break;
  56. }
  57. return S_OK;
  58. }