这是dll
library prjDLL;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }
uses
SysUtils,
Forms,
Windows,
Messages,
Classes,
DLLFormUnit in 'DLLFormUnit.pas' {frmDLLForm},
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
var
DLLApp: TApplication;
DLLScr: TScreen;
function CreateDLLForm(App: TApplication; Scr: TScreen):TForm;
var
ptr
LongInt;
begin
Application := App;
Screen := Scr;
Application.CreateForm(TfrmDLLForm, frmDLLForm);
Application.CreateForm(TForm1, Form1);
result:=frmDLLForm;
end;
procedure ExitDLL(Reason: Integer);
begin
if Reason = DLL_PROCESS_DETACH then
begin
Application := DLLApp;
Screen := DLLScr;
end;
end;
exports
CreateDLLForm,save,Windowmax,openform;
begin
DLLApp := Application;
DLLScr := Screen;
DLLProc := @ExitDLL;
end.
这是dll调用时候所触发的函数
function openform(pbase:basemsg):Thandle;
begin
fhandle:=pbase.phandle;
puserid:=pbase.userid;
Windowsid:=pbase.Windowsid;
BitBtn_Control:='11111111111';
SendMessage(fhandle,WM_ModifyAB,0,Integer(BitBtn_Control));
{frmDLLForm.WindowState:=wsMaximized;
frmDLLForm.BorderIcons:=[biSystemMenu,biMinimize]; }
end;