⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example.dpr

📁 DelphiWin32核心API参考光盘内容.是学习书籍中的源码,便于学习.
💻 DPR
字号:
library Example;

uses
  SysUtils,
  Classes,
  Windows,
  Dialogs,
  DLLAboutForm in 'DLLAboutForm.pas' {AboutBox};

{the exported functions}
exports
  ShowAboutBox name 'ShowAboutBox';

{the DLL entry point function.  this fires whenever a process or thread
 attaches to the DLL.  if a process has already loaded the DLL, any new
 threads created by the process will automatically attach themselves}
procedure DLLMain(AttachFlag: DWORD);
 begin
   {indicate attachement type}
   case AttachFlag of
     DLL_PROCESS_ATTACH: begin
                           MessageBox(0, 'Process: Attaching' , 'Alert', MB_OK);

                           {this function disables the DLL_THREAD_ATTACH and
                            DLL_THREAD_DETACH notifications. if the following
                            line is commented out, the DLL will recieve
                            the thread attach/detach notification}
                           DisableThreadLibraryCalls(hInstance)
                         end;
     DLL_PROCESS_DETACH: MessageBox(0, 'Process: Dettaching', 'Alert', MB_OK);
     DLL_THREAD_ATTACH:  MessageBox(0, 'Thread: Attaching'  , 'Alert', MB_OK);
     DLL_THREAD_DETACH:  MessageBox(0, 'Thread: Dettaching' , 'Alert', MB_OK);
   end;
end;

begin
  {initialize the DLL entry point function}
  DLLProc := @DLLMain;

  {call the entry point function on DLL initialization}
  DLLMain(DLL_PROCESS_ATTACH);
end.


⌨️ 快捷键说明

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