example.dpr
来自「Delphi Win32核心API参考光盘源码 本书包含了常用的Windows」· DPR 代码 · 共 37 行
DPR
37 行
library Example;
uses
SysUtils,
Classes,
Windows,
Dialogs,
DLLAboutForm in 'DLLAboutForm.pas' {AboutBox};
{the exported functions}
exports
ShowAboutBox name 'ShowAboutBox';
{the DLL entry point procedure. this procedure will fire every time a
process or thread attaches to the DLL. if a process has attached to a DLL,
any newly created threads will automatically attach themselves}
procedure DLLMain(AttachFlag: DWORD);
begin
{display attachement type}
case AttachFlag of
DLL_PROCESS_ATTACH: MessageBox(0, 'Process: Attaching', 'Alert', MB_OK);
DLL_PROCESS_DETACH: MessageBox(0, 'Process: Detaching', 'Alert', MB_OK);
DLL_THREAD_ATTACH: MessageBox(0, 'Thread: Attaching' , 'Alert', MB_OK);
DLL_THREAD_DETACH: MessageBox(0, 'Thread: Detaching' , 'Alert', MB_OK);
end;
end;
begin
{initialize the DLL entry function}
DLLProc := @DLLMain;
{call the entry function upon DLL initialization}
DLLMain(DLL_PROCESS_ATTACH);
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?