mainfrm.pas

来自「《delphi深度编程及其项目开发》」· PAS 代码 · 共 44 行

PAS
44
字号
unit MainFrm;

interface

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

type
  TForm1 = class(TForm)
    btnShowModal: TButton;
    BtnShow: TButton;
    procedure btnShowModalClick(Sender: TObject);
    procedure BtnShowClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
//静态引入DLL中的方法
procedure ShowDLLModalForm(aHandle: THandle); stdcall external '..\5-1\DLLShowForm.dll';
procedure ShowDLLForm(aHandle: THandle); stdcall external '..\5-1\DLLShowForm.dll';

var
  Form1: TForm1;

implementation

{$R *.dfm}
//调用DLL里输出的ShowDLLModalForm方法,模式显示窗口
procedure TForm1.btnShowModalClick(Sender: TObject);
begin
  ShowDLLModalForm(Application.Handle);
end;

//调用DLL里输出的ShowDLLForm方法,非模式显示函数
procedure TForm1.BtnShowClick(Sender: TObject);
begin
  ShowDLLForm(Application.Handle);
end;

end.

⌨️ 快捷键说明

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