{
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.
} 
var
  NewItem: TMenuItem;
  I : integer;
begin
  { first create the separator }
  NewItem := TMenuItem.Create(Self);
  NewItem.Caption := '-';
  { add the new item to the Windows menu }
  Windows.Add(NewItem);
  { now create and add a menu item for each form }
  for  I := 0 to Screen.FormCount-1 do
  begin
    NewItem := TMenuItem.Create(Self);
    NewItem.Caption := Screen.Forms[I].Name;
    Windows.Add(NewItem);
  end;
end; 
