AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

KeyEvents manipulieren

Ein Thema von Savar · begonnen am 24. Mär 2006 · letzter Beitrag vom 24. Mär 2006
Antwort Antwort
Savar

Registriert seit: 30. Mai 2004
Ort: Nalbach
43 Beiträge
 
Delphi 7 Enterprise
 
#1

KeyEvents manipulieren

  Alt 24. Mär 2006, 13:20
Ich möchte KeyEvents abfangen, verändern und weitersenden. Geht das überhaupt?
Ich nehmen an, dass ich dazu einen KeyboardHook wie diesen benötige:
Delphi-Quellcode:
library KeyboardHook;

uses
  Windows,
  Messages;

var
  HookHandle: Cardinal = 0;
  WindowHandle: Cardinal = 0;

function KeyboardHookProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
begin
  Result := CallNextHookEx(HookHandle, nCode, wParam, lParam);
  case nCode < 0 of
    true: exit;
    false:
      begin
        //ANWEISUNGEN
      end;
  end;
end;

function InstallHook(Hwnd: Cardinal): Boolean; stdcall;
begin
  Result := False;
  if HookHandle = 0 then begin
    HookHandle := SetWindowsHookEx(WH_KEYBOARD, @KeyboardHookProc, HInstance, 0);
    WindowHandle := Hwnd;
    Result := TRUE;
  end;
end;

function UninstallHook: Boolean; stdcall;
begin
  Result := UnhookWindowsHookEx(HookHandle);
  HookHandle := 0;
end;

exports
  InstallHook,
  UninstallHook;
end.
Mit welchen Anweisungen kann ich das erreichen?
"Every day I have to add another name to the list of people that piss me off." Calvin
  Mit Zitat antworten Zitat
Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#2

Re: KeyEvents manipulieren

  Alt 24. Mär 2006, 13:22
Vermutlich musst du nur in der KeyboardHookProc nCode und / oder wParam und / oder lParam anpassen.
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)
  Mit Zitat antworten Zitat
Savar

Registriert seit: 30. Mai 2004
Ort: Nalbach
43 Beiträge
 
Delphi 7 Enterprise
 
#3

Re: KeyEvents manipulieren

  Alt 24. Mär 2006, 14:11
Zitat von Florian Bernd:
Vermutlich musst du nur in der KeyboardHookProc nCode und / oder wParam und / oder lParam anpassen.
Ja, aber wie mach ich das? (Welche Funktionen gibt es da?)
"Every day I have to add another name to the list of people that piss me off." Calvin
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz