unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,shellapi,<br> StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> Button2: TButton;<br> procedure Button1Click(Sender: TObject);<br> procedure Button2Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> a,b:longint;<br>begin<br> a:=GetSystemMenu(self.handle,false);<br> b:=GetMenuItemCount(a);<br> deleteMenu(a,b-1,MF_BYPOSITION);<br> b:=getmenuitemcount(a);<br> deletemenu(a,b-1,MF_BYPOSITION);<br>end;