Skip to content

Latest commit

 

History

History
106 lines (68 loc) · 3.15 KB

nf-winuser-createmenu.md

File metadata and controls

106 lines (68 loc) · 3.15 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winuser.CreateMenu
CreateMenu function (winuser.h)
Creates a menu. The menu is initially empty, but it can be filled with menu items by using the InsertMenuItem, AppendMenu, and InsertMenu functions.
CreateMenu
CreateMenu function [Menus and Other Resources]
_win32_CreateMenu
_win32_createmenu_cpp
menurc.createmenu
winui._win32_createmenu
winuser/CreateMenu
menurc\createmenu.htm
menurc
VS|winui|~\winui\windowsuserinterface\resources\menus\menureference\menufunctions\createmenu.htm
12/05/2018
CreateMenu, CreateMenu function [Menus and Other Resources], _win32_CreateMenu, _win32_createmenu_cpp, menurc.createmenu, winui._win32_createmenu, winuser/CreateMenu
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
User32.lib
User32.dll
Windows
19H1
CreateMenu
winuser/CreateMenu
c++
APIRef
kbSyntax
DllExport
User32.dll
ext-ms-win-ntuser-menu-l1-1-2.dll
Ext-MS-Win-NTUser-Menu-L1-1-3.dll
CreateMenu
ext-ms-win-ntuser-menu-l1-1-2 (introduced in Windows 10, version 10.0.10240)

CreateMenu function

-description

Creates a menu. The menu is initially empty, but it can be filled with menu items by using the InsertMenuItem, AppendMenu, and InsertMenu functions.

-returns

Type: HMENU

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

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

-remarks

Resources associated with a menu that is assigned to a window are freed automatically. If the menu is not assigned to a window, an application must free system resources associated with the menu before closing. An application frees menu resources by calling the DestroyMenu function.

-see-also

AppendMenu

Conceptual

CreatePopupMenu

DestroyMenu

InsertMenu

InsertMenuItem

Menus

Reference

SetMenu