⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.pas

📁 《Delphi7编程100例》代码,书配资料
💻 PAS
字号:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;


type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    procedure SysCommand(var Msg: TMessage); message wm_SysCommand;
  public
    { Public declarations }
    procedure About;  
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
  SysMenu: hMenu;
begin
  SysMenu := GetSystemMenu(Handle, False);
  ModifyMenu(SysMenu, sc_Close, mf_ByCommand, sc_Close, '模拟关闭窗体功能(&C)'#9'Alt+F4');
  DeleteMenu(SysMenu, 0, mf_ByPosition);
  AppendMenu(SysMenu, mf_Separator, 0, #0);
  AppendMenu(SysMenu, mf_ByCommand, 666, '关于(&A)...');
end;

procedure TForm1.SysCommand(var Msg: TMessage);
begin
  inherited;
  if Msg.wParam = 666 then About;
end;

procedure TForm1.About;
begin
  MessageDlg('您点击了About菜单项!', mtInformation,[mbOk], 0);
end;

end.
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -