hooku.pas

来自「delphi下 系统编程 钩子函数的调用-under the system pr」· PAS 代码 · 共 36 行

PAS
36
字号
unit HookU;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Memo1: TMemo;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

function EnableHotKeyHook: BOOL; external 'HKTEST.DLL';
function DisableHotKeyHook: BOOL; external 'HKTEST.DLL';

procedure TForm1.Button1Click(Sender: TObject);
begin
  if EnableHotKeyHook then
    ShowMessage('Keyboard Hook 币笆, 

⌨️ 快捷键说明

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