解决方案 »

  1.   

    unit uformdll;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs,math, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      procedure apphandle(handle1:thandle);stdcall;
      procedure formshow;stdcall;implementation{$R *.dfm}
    procedure apphandle(handle1:thandle);
    begin
    application.Handle:=handle1;
    end;
    procedure formshow;
    begin
    form1:=tform1.Create(application);
    form1.ShowModal;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
     color:=randomrange(0,255*255*255);
    end;end.