你的意思是在窗口的系统菜单中加入新菜单,例如加入一个分隔条再加一个“关于...“菜单,可以这样做:
...
private
procedure AppMsg(Var Msg:TMsg;Var Handled:Boolean);
Var Form1:TForm1;
Const WM_about=WM_USER+1;
procedure TForm1.FormCreate(Sender:TObject);
Var hm:HMenu;
begin
hm:=GetSystemMenu(handle,false);
AppendMenu(hm,mf_bycommand,mf_separator,nil);
AppendMenu(hm,mf_bycommand,WM_ABOUT,'关于(&B)...');
hm:=GetSystemMenu(Application.handle,false);
AppendMenu(hm,mf_Bycommand,mf_separator,nil);
AppendMenu(hm,mf_bycommand,WM_ABOUT,'关于(&B)...');
Application.OnMessage:=AppMsg;
end;
procedure TForm1.AppMsg(Var Msg:TMsg;Var Handled:Boolean);
begin
if msg.message=WM_SYSCOMMAND THEN
if msg.wParam=WM_ABOUT then
begin
ShowAbout;//调用显示关于对话框过程
Handled:=true;//消息已处理
end;
end;
end.