那是用消息处理的。
procedure MenuSelect(var Msg:TMessage); message WM_MENUSELECT;
procedure TForm1.MenuSelect(var Msg: TMessage);
begin
if (Hiword(msg.wParam) and MF_SYSMENU)=MF_SYSMENU then
case Loword(msg.wparam) of
SC_CLOSE: StatusBar1.SimpleText := 'Close';
SC_MOVE: StatusBar1.SimpleText := 'Move';
SC_SIZE: StatusBar1.SimpleText := 'Resize';
end;
Msg.Result := 0;
end;