Hi Leute,
ich habe ein Programm, welches in einem Fenster eine DirectDraw Animation hat. In dieses Fenster render ich eigenen Debug Informationen.
Ich habe also durch etwas Hooking Zugriff auf das DirectX Objekt bekommen und gebe vor der eigentlichen Bildschirmausgabe des Backbuffers noch etwas hinzu (Debug Inofmrationen).
Der Debugger liegt also als InjectionsCode (DLL) vor. Nun möchte ich diesem Debugger gerne Befehle geben auf die er reagieren soll. Dazu ist IPC (Inter Process Communication) nötig. Die einfaste aller Methoden ist dabei das SendMessage Postmessage System welches Windows mitliefert (IMO Pipes, TCP, UDP, SharedMemory wäre zu aufwenidig).
Ziel:
Also habe ich den Code des Debugger so geändert, dass auch ein Windows Message Hook gesetzt wird, der die einkommenden Msg's kontrolliert.
WM_USER ist eine Zahl, die die Grenzen zwischen belegten WindowsMsg-ID's und benutzerdefinierten WindowsMsg-ID's angibt.
Wenn ich nun mit einem dritten Programm ein SendMessage/PostMessage auf das besagte debuggt Programm setzte, dann soll der Debugger diese Nachricht erhalten und darauf reagieren.
Welche Sorte von Hook ist nötig, um ein Sendmessage (z.B. WM_USER + 5) zu filtern. Ich verstehe nicht ganz die Unterschiede bzw. die Bedeutungen der einzelnen Hook's.
Hier ein kleiner Auszug aus der API
Zitat: |
WH_CALLWNDPROC
Installs a hook procedure that monitors messages before the system sends them to the destination window procedure. For more information, see the CallWndProc hook procedure.
ja ok hört sich gut an
WH_CALLWNDPROCRET
Installs a hook procedure that monitors messages after they have been processed by the destination window procedure. For more information, see the CallWndRetProc hook procedure.
wie auch immer, vorher nacher ist doch egal, hört sich aucn gut an
WH_CBT
Installs a hook procedure that receives notifications useful to a computer-based training (CBT) application. For more information, see the CBTProc hook procedure.
nö, nicht das, was ich suche
WH_DEBUG
Installs a hook procedure useful for debugging other hook procedures. For more information, see the DebugProc hook procedure.
kein plan - hab nichts weiter gefunden - also auch nicht das was ich suche
WH_GETMESSAGE
Installs a hook procedure that monitors messages posted to a message queue. For more information, see the GetMsgProc hook procedure.
das klingt schon wieder besser, Wo sitder unterschied zu oben, ob es nun an einen Queue geht oder peng?
WH_JOURNALPLAYBACK
Installs a hook procedure that posts messages previously recorded by a WH_JOURNALRECORD hook procedure. For more information, see the JournalPlaybackProc hook procedure.
ja vielleicht? aber das ist glaube ich was mit Hardware queues
(glaube ich gelesen zu haben)
WH_JOURNALRECORD
Installs a hook procedure that records input messages posted to the system message queue. This hook is useful for recording macros. For more information, see the JournalRecordProc hook procedure.
auch gut ! aber das ist glaube ich was mit Hardware queues
(glaube ich gelesen zu haben)
WH_KEYBOARD
Installs a hook procedure that monitors keystroke messages. For more information, see the KeyboardProc hook procedure.
nein das brauche ich nicht
WH_MOUSE
Installs a hook procedure that monitors mouse messages. For more information, see the MouseProc hook procedure.
nein das brauche ich nicht
WH_MSGFILTER
Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. For more information, see the MessageProc hook procedure.
ne das auch nicht
WH_SHELL
Installs a hook procedure that receives notifications useful to shell applications. For more information, see the ShellProc hook procedure.
sehr sehr oberflächlich beschrieben - hört sich aber nicht danach an
NEIN
WH_SYSMSGFILTER
Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procedure monitors these messages for all applications in the system. For more information, see the SysMsgProc
hook procedure.
Nö !
|
Welcher Hook ist der den ich Suche?
PS: Ich meine gelesen zu haben das manche auf Postmessage anders reagieren als auf Sendmessage(unterschied war glaube ich [bin mir nicht sicher], dass das eine ne Rückmeldung gibt das andere nicht, also das eine ist schnell und unsicher das andere langsam und sicher)
Gruß Tobi