mirror of https://github.com/tongzx/nt5src
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.
66 lines
1.8 KiB
66 lines
1.8 KiB
//==============================================================;
|
|
//
|
|
// This source code is only intended as a supplement to
|
|
// existing Microsoft documentation.
|
|
//
|
|
//
|
|
//
|
|
//
|
|
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
|
|
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
|
|
// PURPOSE.
|
|
//
|
|
// Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
|
|
//
|
|
//
|
|
//
|
|
//==============================================================;
|
|
|
|
#include "Sky.h"
|
|
|
|
const GUID CSkyBasedVehicle::thisGuid = { 0x2974380f, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } };
|
|
|
|
//==============================================================
|
|
//
|
|
// CSkyBasedVehicle implementation
|
|
//
|
|
//
|
|
HRESULT CSkyBasedVehicle::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed)
|
|
{
|
|
HRESULT hr = S_OK;
|
|
CONTEXTMENUITEM menuItemsNew[] =
|
|
{
|
|
{
|
|
L"Sky based", L"Add a new sky based vehicle",
|
|
IDM_NEW_SKY, CCM_INSERTIONPOINTID_PRIMARY_NEW, 0, CCM_SPECIAL_DEFAULT_ITEM
|
|
},
|
|
{ NULL, NULL, 0, 0, 0 }
|
|
};
|
|
|
|
// Loop through and add each of the menu items
|
|
if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_NEW)
|
|
{
|
|
for (LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++)
|
|
{
|
|
hr = pContextMenuCallback->AddItem(m);
|
|
|
|
if (FAILED(hr))
|
|
break;
|
|
}
|
|
}
|
|
|
|
return hr;
|
|
}
|
|
|
|
HRESULT CSkyBasedVehicle::OnMenuCommand(IConsole *pConsole, long lCommandID)
|
|
{
|
|
switch (lCommandID)
|
|
{
|
|
case IDM_NEW_SKY:
|
|
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);
|
|
break;
|
|
}
|
|
|
|
return S_OK;
|
|
}
|