Page 1 of 1

P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID

Posted: Thu Feb 21, 2019 5:20 pm
by BenBaron
Hi guys,

I am adding a menu item to P3Ds menu. With SimConnect, this is automatically added to P3Ds Add-Ons menu item as a child. But now, with the PDK method, the menu item is placed directly in the main menu bar, which I don't want. So, is it somehow possible to retrieve the MenuID of an existing menu item (Add-Ons) to pass it to AddItem as parent argument?

All the best, Benny

Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID

Posted: Thu Feb 21, 2019 5:31 pm
by Beau Hollis
I believe you can use ADDON_ITEM_ID. The menu IDs for all the top level items are listed in the MenuService header:
#define NO_PARENT 0x0000
#define SCENARIO_ITEM_ID 0x1001
#define VEHICLE_ITEM_ID 0x1002
#define WORLD_ITEM_ID 0x1003
#define OPTIONS_ITEM_ID 0x1004
#define VIEWS_ITEM_ID 0x1005
#define HELP_ITEM_ID 0x1006
#define WINGMEN_ITEM_ID 0x1008
#define TOOLS_ITEM_ID 0x100d
#define TEST_ITEM_ID 0x100e
#define ADDON_ITEM_ID 0x1010
#define ANALYSIS_ITEM_ID 0x1011
#define NETWORK_ITEM_ID 0x1012
#define NAVIGATION_ITEM_ID 0x1013
#define ALL_CHILDREN 0xFFFF
Thanks

Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID

Posted: Thu Feb 21, 2019 6:19 pm
by BenBaron
Thanks Beau for your reply and the hint for the defines.

SCENARIO_ITEM_ID or ANALYSIS_ITEM_ID are working fine as parent MenuID. ADDON_ITEM_ID doesn't work, though. Produces a HRESULT of E_FAIL.

Greets, Benny

Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID

Posted: Mon Apr 15, 2019 4:09 pm
by BenBaron
So, unfortunately this still produces the above mentioned error in 4.5 on my side. Not able to add a menu item to the Addon submenu.

All the best,

Benny

Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID

Posted: Mon Jul 08, 2019 11:25 am
by Kaiii3
I can confirm that using the latest SDK/PDK it is still not working using follwoing code:

Code: Select all

MenuService->AddItem(MenuItemAIG->GetId(), ADDON_ITEM_ID, 0);

Re: P3D::PdkServices::GetMenuService()->AddItem with unknown parent MenuID

Posted: Mon Nov 04, 2019 3:10 pm
by BenBaron
Hi guys,

just wanted to chime in that also with Prepar3D v4 SDK 4.5.13.32097 this doesn't seem to be fixed.

Greets,

Benny