/*
MenuItem, FormCount, Forms example 
This example assumes that the main form of the application has a main menu with a menu item. The following code adds a separator, and the name of all forms to the menu.
*/
TMenuItem *NewItem = new TMenuItem(Window1); // create the separator
NewItem->Caption = "-";
Window1->Add(NewItem); // add it to the Window menu
// now create and add a menu item for each form
for (int i = 0; i < Screen->FormCount; i++)
{
  NewItem = new TMenuItem(Window1);
  NewItem->Caption = Screen->Forms[i]->Name;
  Window1->Add(NewItem);
} 
