Her er et eksempel på, hvordan du indsætter et menupunkt i systemmenuen.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
procedure FormCreate(Sender: TObject);
private
procedure WMSysCommand(VAR Message: TWMSysCommand); message WM_SYSCOMMAND;
public
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
Inherited;
IF Message.CmdType = $F200 THEN form2.showmodal
end;
procedure TForm1.FormCreate(Sender: TObject);
var s : string;
begin
s := '&Copyright...';
AppendMenu(GetSystemMenu(Handle, False), MF_STRING, $F200, PChar(s));
end;
end.
|