pluginsfrm.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:1k
- 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.