AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Kyboard-Hook im selben Process aber vom parallelen Thread
Thema durchsuchen
Ansicht
Themen-Optionen

Kyboard-Hook im selben Process aber vom parallelen Thread

Ein Thema von Reddog · begonnen am 29. Jul 2004 · letzter Beitrag vom 22. Aug 2004
Antwort Antwort
Benutzerbild von Reddog
Reddog

Registriert seit: 18. Jul 2004
Ort: Würzburg
56 Beiträge
 
#1

Kyboard-Hook im selben Process aber vom parallelen Thread

  Alt 29. Jul 2004, 11:34
Hallo,

ich habe mal einen neuen Thread aufgemacht. Ich habe es dank der Hilfe mehrerer Poster geschafft eine DLL in einen fremden Process(ein Spiel) "einzuschleusen". Diese wird durch CreateRemoteThread geladen. Allerdings kann ich irgendwie keinen localen Keyboard-Hook installieren. Den brauche ich aber um Aktionen auf Tastendruck auszuführen.
Es klappt auch nicht, wenn ich versuche bei SetWindowsHookEx das Handle des DLL-Moduls zu übergeben und die Thread-ID des Spiel-Threads. Wenn ich die DLL direkt in ein Test-Programm lade, dann klappt alles wunderbar, also muss es wohl daran liegen, dass ein anderer Thread innerhalb desselben Processes die DLL lädt.

Fällt jemandem ein Weg ein, um den Hook doch laden zu können?

Eigentlich ist mir jede Lösung recht. Hauptsache die geladene DLL kann auf Tastenbetätigung reagieren, ob jetzt global oder nur innerhalb des Spiels, ist mir im Grunde egal.

Wunderbar wäre natürlich, wenn jemand einen Weg kennt, um die DLL direkt in den Spiel-Thread zu laden.

Danke,
Reddog.
All prime numbers are odd with the exception of two, which is an odd prime
  Mit Zitat antworten Zitat
Blutiger Anfänger
(Gast)

n/a Beiträge
 
#2

Re: Kyboard-Hook im selben Process aber vom parallelen Threa

  Alt 22. Aug 2004, 00:03
Die Grundlagen sind wichtig:

Zitat von PSDK:
A global hook monitors messages for all threads in the same desktop as the calling thread. [b]A thread-specific hook monitors messages for only an individual thread.[/a] A global hook procedure can be called in the context of any application in the same desktop as the calling thread, so the procedure must be in a separate dynamic-link library (DLL) module. A thread-specific hook procedure is called only in the context of the associated thread. If an application installs a hook procedure for one of its own threads, the hook procedure can be in either the same module as the rest of the application's code or in a DLL. If the application installs a hook procedure for a thread of a different application, the procedure must be in a DLL. For information, see Dynamic-Link Libraries.
  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 01:25 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