2.2.4.32.1 OriginObject::AddInternalMenu

Description

Adds an internal menu to the main menu created from resource

Syntax

BOOL AddInternalMenu( HWND hMenu, int nMenuID, int nMenuPos )

Parameters

hMenu
[input] Handle to the menu where the internal menu needs to be added
nMenuID
[input] The resource ID of the menu object passed
nMenuPos
[input] The submenu position of the menu object passed

Return

TRUE if successful, FALSE otherwise

Examples

EX1

#include <Control.h> 
#include <OC_Res.h>
void    OriginObject_AddInternalMenu_Ex1(Menu* pmenu, int nId = IDR_CM_WKS)
{
    Worksheet wks = Project.ActiveLayer();
    HINSTANCE hInstOutil = GetModuleHandle(MODULE_OU);
    if(pmenu->Load(hInstOutil, nId, 1))
    {
        HWND hMenu = pmenu->GetSafeHmenu();
        if(hMenu)
            wks.AddInternalMenu(hMenu, nId, 1);
    }
}

Remark

Adds if needed an internal menu to the main menu created from resource

See Also

Header to Include

origin.h