Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

true_jeamy

@true_jeamy
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • About Delphi KeyBoard Hook question,I need your help !
    T true_jeamy

    I program on Delphi 7 . First I Create a DLL Code :

    library HookDLL;

    { Important note about DLL memory management: ShareMem must be the
    first unit in your library's USES clause AND your project's (select
    Project-View Source) USES clause if your DLL exports any procedures or
    functions that pass strings as parameters or function results. This
    applies to all strings passed to and from your DLL--even those that
    are nested in records and classes. ShareMem is the interface unit to
    the BORLNDMM.DLL shared memory manager, which must be deployed along
    with your DLL. To avoid using BORLNDMM.DLL, pass string information
    using PChar or ShortString parameters. }

    uses
    SysUtils,Classes,Dialogs,windows;

    {$R *.res}

    var
    hookHandle:HHOOK;
    hookCode:string;

    function KeyBoardHook(code:Integer;
    wparaw:Cardinal;
    lparaw:Cardinal):Cardinal;stdcall;
    begin
    if code >0 then
    begin
    // hookCode := hookCode + IntToStr(code);
    ShowMessage(IntToStr(code));
    CallNextHookEx(hookHandle,code,wparaw,lparaw);
    end;
    end;

    function StartHook(instance:Cardinal;SysType:Integer):Boolean;stdcall;
    begin
    hookHandle := SetWindowsHookEx(WH_KEYBOARD,@KeyBoardHook,instance,SysType);
    if hookHandle <> 0 then
    begin
    ShowMessage('install Success!');
    Result := True;
    end
    else
    begin
    ShowMessage('install Error!');
    Result := False;
    end;
    end;

    function UnSetHook:Boolean;stdcall;
    begin
    Result := UnhookWindowsHookEx(hookHandle);
    end;

    function GetPass:string;stdcall;
    begin
    Result := hookCode;
    end;

    exports
    StartHook,GetPass,UnSetHook;

    begin

    end.

    and use code

    unit SetHook;

    interface

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

    type
    TForm1 = class(TForm)
    btn1: TButton;
    btn2: TButton;
    btn3: TButton;
    tmr1: TTimer;
    procedure btn1Click(Sender: TObject);
    procedure btn2Click(Sender: TObject);
    procedure btn3Click(Sender: TObject);
    procedure tmr1Timer(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }

    end;

    var
    Form1: TForm1;

    function UnSetHook:Boolean; external 'HookDLL.dll';
    function GetPass:string; external 'HookDLL.dll';
    function StartHook(instance:Car

    Delphi help delphi graphics performance question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups