LoadMenu

  HMENU LoadMenu(hinst, lpMenuName)    
  HANDLE hinst; /* handle of application instance */
  LPCTSTR lpMenuName; /* menu-name string or menu-resource identifier */

The LoadMenu function loads the specified menu resource from the executable file associated with the given application instance.

Parameters

hinst

Identifies the instance of the module containing the menu resource to be loaded.

lpMenuName

Points to a null-terminated string that contains 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. The MAKEINTRESOURCE macro can be used to create this value.

Return Value

The return value is the handle of the menu resource if the function is successful. Otherwise, it is NULL. To obtain extended error information, use the GetLastError function.

Comments

Before termination, applications should use the DestroyMenu function to destroy the menu and free memory that the loaded menu occupied.

The LoadMenu function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set).

See Also

LoadMenuIndirect