dllform.dpr

来自「Form from DLL (Delphi source code)」· DPR 代码 · 共 47 行

DPR
47
字号
library DLLForm;

uses
  ShareMem,
  Windows,
  SysUtils,
  Classes,
  Forms,
  Dialogs,
  FormDLL in 'FormDLL.pas' {DLLForm},
  FormDLL2 in 'FormDLL2.pas' {DLLForm2},
  DLL_Shared in 'DLL_Shared.pas';

{$R *.RES}

procedure DLLEntryPoint(dwReason: DWORD); stdcall; 
begin
   case dwReason of
      DLL_PROCESS_ATTACH: 
      begin
         DLLAppHandle := Application.Handle;
         DLLApp := Application;
         DLLScr := Screen;
      end;
      DLL_PROCESS_DETACH: 
      begin
         DestroyModeLessForm;
         DestroyMDIChildForm;
         RestoreAppAndScr;
         Application.Handle := DLLAppHandle;
      end;
      DLL_THREAD_ATTACH : {ShowMessage('Thread Attach')};
      DLL_THREAD_DETACH : {ShowMessage('Thread Detach')};
   end;
end;

exports
    DLLEntryPoint;

begin
    DLLProc := @DLLEntryPoint;         
    DLLEntryPoint(DLL_PROCESS_ATTACH); 
end.



⌨️ 快捷键说明

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