Help / WLanguage / WLanguage functions / Controls, pages and windows / Window functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
EnumMenu (Function)
In french: EnumèreMenu
  • the name of nth option or sub-option found in the main menu of window.
  • the name of nth option or sub-option found in a custom context menu (created with WINDEV or WINDEV Mobile).
In a loop, this function is used to enumerate the menu options of a window as well as the sub-options of a menu option.
iPhone/iPad This function can only be used to enumerate the options of a popup menu.
i is int = 1
MenuName is string
MenuName = EnumMenu(MyWindow, 1) // Read the 1st menu of the window
WHILE MenuName <> ""
j is int = 1
NameSubMenu is string
NameSubMenu = EnumMenu(MenuName, j) // Read the 1st option of the menu
WHILE NameSubMenu <>""
Trace(" " + NameSubMenu)
j++ // Next option
NameSubMenu = EnumMenu(MenuName, j)
i++ // Next menu
MenuName = EnumMenu(MyWindow, i)
<Result> = EnumMenu(<Parent object> , <Option number>)
<Result>: Character string
  • Name of the option,
  • Empty string ("") if <Parent object> corresponds to a menu option or if the enumeration is over.
The option name was defined in the window editor when creating the menu.
<Parent object>: Character string
  • Name of the window containing the menus to list. This window must be opened when using this function.
  • Name of the menu that contains the options to be listed.
<Option number>: Integer
Number of the option whose name is requested.
A WLanguage error is displayed in the following cases:
  • <Option number> is a negative integer.
  • <Option number> is greater than the number of menu options + 1.
  • <Parent object> is not a window, a menu or a menu option.
  • <Parent object> is a window that is not opened. To list a menu found in a window that is not opened, use EnumSubElement.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help