大家 有没有这方面的资料,提供一份,高分相送?

解决方案 »

  1.   

    library DLLShowForm;uses
      SysUtils,
      Classes,
      DLLFrm in 'DLLFrm.pas' {frmDLL};
    {$R *.res}
    //输出ShowDLLModalForm,ShowDLLForm接口方法,以便外部程序调用
    exports
      ShowDLLModalForm, ShowDLLForm;
    begin
    end.
    ————————————————————————————————
    unit DLLFrm;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TfrmDLL = class(TForm)
      private
        { Private declarations }
      public
        { Public declarations }
      end;{声明要引出的方法}
    procedure ShowDLLModalForm(aHandle: THandle); stdcall; //模式显示窗口
    procedure ShowDLLForm(aHandle: THandle); stdcall; //非模式显示窗口implementation{$R *.dfm}//模式显示窗口
    procedure ShowDLLModalForm(aHandle: THandle);
    begin
      Application.Handle := aHandle; //传递应用程序句柄
      with TfrmDLL.Create(Application) do //创建窗体
      begin
        try
          ShowModal; //模式显示窗体
        finally
          free;
        end;
      end;
    end;
    //非模式显示窗口
    procedure ShowDLLForm(aHandle: THandle);
    begin
      Application.Handle := aHandle; //传递应用程序句柄
      with TfrmDLL.Create(application) do //创建窗体
        Show; //非模式显示窗体
    end;
    end.