Skip to content

Latest commit

 

History

History
125 lines (76 loc) · 3.96 KB

nf-winuser-createpopupmenu.md

File metadata and controls

125 lines (76 loc) · 3.96 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.CreatePopupMenu
CreatePopupMenu function (winuser.h)
Creates a drop-down menu, submenu, or shortcut menu.
CreatePopupMenu
CreatePopupMenu function [Menus and Other Resources]
_win32_CreatePopupMenu
_win32_createpopupmenu_cpp
menurc.createpopupmenu
winui._win32_createpopupmenu
winuser/CreatePopupMenu
menurc\createpopupmenu.htm
menurc
VS|winui|~\winui\windowsuserinterface\resources\menus\menureference\menufunctions\createpopupmenu.htm
12/05/2018
CreatePopupMenu, CreatePopupMenu function [Menus and Other Resources], _win32_CreatePopupMenu, _win32_createpopupmenu_cpp, menurc.createpopupmenu, winui._win32_createpopupmenu, winuser/CreatePopupMenu
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
User32.lib
User32.dll
Windows
19H1
CreatePopupMenu
winuser/CreatePopupMenu
c++
APIRef
kbSyntax
DllExport
User32.dll
Ext-MS-Win-NTUser-Menu-l1-1-0.dll
Ext-MS-Win-NTUser-Menu-l1-1-1.dll
ext-ms-win-ntuser-menu-l1-1-2.dll
Ext-MS-Win-NTUser-Menu-L1-1-3.dll
CreatePopupMenu
ext-ms-win-ntuser-menu-l1-1-0 (introduced in Windows 8)

CreatePopupMenu function

-description

Creates a drop-down menu, submenu, or shortcut menu. The menu is initially empty. You can insert or append menu items by using the InsertMenuItem function. You can also use the InsertMenu function to insert menu items and the AppendMenu function to append menu items.

-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

The application can add the new menu to an existing menu, or it can display a shortcut menu by calling the TrackPopupMenuEx or TrackPopupMenu functions.

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.

Examples

For an example, see Adding Lines and Graphs to a Menu.

-see-also

AppendMenu

Conceptual

CreateMenu

DestroyMenu

InsertMenu

InsertMenuItem

Menus

Reference

SetMenu

TrackPopupMenu

TrackPopupMenuEx