procedure TForm1.Button1Click(Sender: TObject);
var
hSysMenu:HMenu;
begin
hSysMenu:=GetSystemMenu(Handle,False);
if (hSysMenu>0) then
AppendMenu(hSysMenu,MF_STRING,100,'hello');
end;
procedure TForm1.WsysMenu(var Msg:TMessage);
//message WM_SYSCOMMAND
begin
if (Msg.WParam=100) then
ShowMessage('hello');
inherited ;
end;