VCL Delphi

type
TForm1 = class(TForm)
PopupMenu1: TPopupMenu;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure MenuItemClick(Sender: TObject);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var MenuItem: TMenuItem;
begin
MenuItem := TMenuItem.Create(PopupMenu1);
MenuItem.Caption := 'C:\programlar\deneme.exe';
MenuItem.OnClick := MenuItemClick;
PopupMenu1.Items.Add(MenuItem);
end;
procedure TForm1.MenuItemClick(Sender: TObject);
var MenuCaption: string;
begin
MenuCaption := TMenuItem(Sender).Caption;
WinExec(PChar(MenuCaption), SW_SHOWNORMAL);
end;