📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TEnableHotKeyHook = function: BOOL; stdcall;
TDisableHotKeyHook = function: BOOL; stdcall;
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
var
EnableHotKeyHook: TEnableHotKeyHook;
DisableHotKeyHook: TDisableHotKeyHook;
DllHandle: THandle;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
EnableHotKeyHook;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
DisableHotKeyHook;
end;
initialization
DllHandle := LoadLibrary('KeyboardHOOK.dll');
if DllHandle <> 0 then
begin
@EnableHotKeyHook := GetProcAddress(DllHandle,'EnableHotKeyHook');
@DisableHotKeyHook := GetProcAddress(DllHandle,'DisableHotKeyHook');
end;
finalization
FreeLibrary(DllHandle);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -