LabWindows/CVI

Content Type
Programming Language
Current manual

NewMenu

NewMenu

int NewMenu (int menuBarHandle, char menuName[], int beforeMenuID);

Purpose

Adds a new menu to a menu bar and returns a menu ID that you can use to specify the menu in subsequent function calls.

Parameters

Input
Name Type Description
menuBarHandle int Specifier for a particular menu bar that is currently in memory. You can obtain this handle from functions such as LoadMenuBar and NewMenuBar.

If the menu bar was automatically loaded through LoadPanel, use GetPanelMenuBar to get the menu bar handle.
menuName char [] New menu name to add to the menu bar.

To add an underline accelerator to a menu name, precede the letter to underline with two underscores; for example, __File.
beforeMenuID int ID of the menu above which to insert the new menu. To place the new menu at the end of the menu bar, pass –1.

You can obtain this ID from functions such as NewMenu and NewSubMenu.

Return Value

Name Type Description
menuID int ID you use to reference the menu in subsequent function calls. Negative values indicate that an error occurred. Zero is not a valid ID.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Example

Refer to apps\uirview\uirview.cws for an example of using the NewMenu function.

Was this information helpful?