Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GetMenuItems

Returns all items of the active menu matching Caption as a list of strings.

Returns nothing if no active menu exists, no menu with the specified caption is found, or the character is disconnected.

For structured records instead of strings, use GetMenuItemsEx. For items of the last menu regardless of caption, use GetLastMenuItems.

Возвращает все элементы активного меню с заголовком Caption в виде списка строк.

DWS

function GetMenuItems(Caption: String): TArray<String>;

DWS overload:

procedure GetMenuItems(Caption: String; var TL: TStringList);

Pascal Script

procedure GetMenuItems(Caption: String; var TL: TStringList);

Python

def GetMenuItems(Caption: str) -> list[str]: ...

Pascal Example

var
  Items: TStringList;
  i: Integer;
begin
  Items := TStringList.Create;
  GetMenuItems('Tinkering', Items);
  for i := 0 to Items.Count - 1 do
    AddToSystemJournal(Items[i]);
  Items.Free;
end.

Python Example

items = GetMenuItems('Tinkering')
for item in items:
    AddToSystemJournal(item)

See Also

GetMenuItemsEx, GetLastMenuItems, AutoMenu, WaitMenu