系统菜单上添加自定义的菜单项

procedure WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;

const
idMyFunc = $f200;

procedure TForm1.FormCreate(Sender: TObject);
begin
AppendMenu(GetSystemMenu(Handle, False), MF_STRING, idMyFunc, ’我的系统菜单项’);
end;

procedure TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
inherited;
if Msg.CmdType and $FFF0 = idMyFunc then
   ShowMessage(’我的系统菜单项’);
end;

你可能感兴趣的:(自定义)