procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage:=xy;
end;
procedure TForm1.xy(var Msg: TMsg;
var Handled: Boolean);
begin
if Msg.wParam=100 then
ShowMessage('ok');
end;
procedure TForm1.Button1Click(Sender: TObject);
var H: HWND;
i: integer;
begin
H:=GetSystemMenu(Application.Handle,false);
for i:=1 to 4 do
DeleteMenu(H,0,MF_BYPOSITION);
InsertMenu(H,1,MF_STRING or MF_BYPOSITION,100,'My Menu');
end;
//自己看看好了!