LoadMenuA function

Loads the specified menu resource from the executable (.exe) file associated with an application instance.

Syntax

HMENU LoadMenuA(
  HINSTANCE hInstance,
  LPCSTR    lpMenuName
);

Parameters

hInstance

Type: HINSTANCE

A handle to the module containing the menu resource to be loaded.

lpMenuName

Type: LPCTSTR

The name of the menu resource. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. To create this value, use the MAKEINTRESOURCE macro.

Return Value

Type: HMENU

If the function succeeds, the return value is a handle to the menu resource.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

The DestroyMenu function is used, before an application closes, to destroy the menu and free memory that the loaded menu occupied.

Examples

For an example, see Displaying a Shortcut Menu

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

LoadMenuIndirect

MAKEINTRESOURCE

Menus

Reference