MENUINFO() Function - Get Menu Information
Syntax
MENUINFO(sysgui,contextid{,ERR=lineref}{,END=lineref})
Description
The MENUINFO() function retrieves a string that contains the structure of a menu.
Parameter |
Description |
---|---|
sysgui |
Valid SYSGUI channel. |
contextid |
Context ID. |
ERR=lineref |
Branch to be taken if an error occurs during execution. |
If contextid refers to an invalid context ID, MENUINFO() generates an !ERROR=17.
Menu Substring Format
The following template and table define the format of the menu substring:
class:u(1),type:u(1),flags:u(4),id:u(2),accelkey:u(2),submenu:u(2),siblingmenu:u(2),name:c(1*=0),title:c(1*=0)
Field |
Offset/ Length |
Description |
---|---|---|
class,type |
1,2 |
Menu type as defined by CTRL(sysgui,controlid,4). |
flags |
3,4 |
All relevant flags for the menu item. To get menu item flag values, use CTRL(2). |
id |
7,2 |
Menu item ID. |
reserved |
9,2 |
Reserved for future use. |
submenu |
11,2 |
Submenu by way of a two-byte offset from the beginning of the string to any submenu associated with this menu ID. If no submenus are accessed through this menu ID, it is set to 0. |
siblingmenu |
13,2 |
Sibling menu by way of a two-byte offset from the beginning of the string to any submenu associated with this menu ID. If no sibling menu items are accessed through this menu ID, it is set to 0. |
name |
15, n |
Null-terminated string that contains the menu name, as defined by ResBuilder. If no name is associated, a name is generated based on the ID and the menu. For example, if a menu has an ID of 10, then the generated name would be MENU10. |
title |
15+ n +1, m |
Null-terminated string that contains the menu item title. |
All fields are repeated for each menu item. To print a decimal form of the id field, issue DEC($00$+ fieldname$).
Example
dim m$:"class:u(1),type:u(1),flags:u(4),id:u(2),akey:u(2),suboff:u(2),
: "siboff:u(2),name:c(1*=0),title:c(1*=0)"
m$=menuinfo(sysgui,context)