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

📄 pluginsfrm.pas

📁 《delphi深度编程及其项目开发》
💻 PAS
字号:
unit pluginsfrm;

interface

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

type
  TfrmPlugins = class(TForm)
    Label1: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
//定义ShowDLLForm,用于打开本窗体
function ShowDLLForm(AHandle: THandle; ACaption: string): Boolean; Stdcall;

//输出标题
function GetCaption: Pchar; stdcall;

implementation

{$R *.dfm}

//输出标题
function GetCaption: Pchar; stdcall;
begin
  Result := '插件演示NO1';
end;

//打开本窗体
function ShowDLLForm(AHandle: THandle; ACaption: string): Boolean;
var
  DLL_Form: TfrmPlugins;
begin
  result := true;
  try
    application.Handle := AHandle; //传递应用程序地址
    DLL_Form := TFrmPlugins.Create(Application);//创建窗体
    try
      DLL_Form.caption := Acaption;//给窗体标题赋值
      DLL_Form.ShowModal;  //模式显示窗体
    finally
      DLL_Form.Free;
    end;
  except
    result := false;
  end;
end;
end.

⌨️ 快捷键说明

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