SimApi Control getMainHMENU

From SIMboxWiki
Jump to navigation Jump to search



Icon attributes.pngstatic void* SimApi::Control::getMainHMENU()

    Description

    Gets the handle to the main simulation menu.

    Return

    Type: void *   Description: The handle to the main menu. The return value is HMENU returned as void *.

    Remarks
    

This function is used to append new menu items to the main window menu. Location the menu: The main simulation menu is located at the top of the simulation window. The default menu items are : File, View, Display, window, Help, Rate. Main menu items: Each SIMBox Extension has the ability to add menu items to the main menu when it loads. The list of extensions that are being loaded is determined according to which extension collections were specified in the command line or in the SIMbox Object Editor (SIMBox toolkit).


    Code Sample
    

//This example adds a menu item to the main menu during the start function (The SIMbox Extension life cycle).
bool MyExtension::start()
{
	SimApi::FrameWork::appendMenu((HMENU)SimApi::Control::getMainHMENU(), MF_POPUP| MF_ENABLED,(UINT)m_menuHandle , MENU_NAME,this); 
}