Delphi-PRAXiS
Seite 1 von 3  1 23      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Windows Messages sniffen. (https://www.delphipraxis.net/44330-windows-messages-sniffen.html)

dde 17. Apr 2005 23:15


Windows Messages sniffen.
 
Was wisst ihr drüber. Ein paar Explorer-Messages sollen nämlich auch mein Prog erreichen, damit der unabhängig vom User die System-Info aktualisiert. Z.b. die geöffneten Fenster..

fylo 18. Apr 2005 07:21

Re: Windows Messages sniffen.
 
Hi

kannst du dein Problem einwenig genauer beschreiben? Welche Messages meinst du und was möchtest du sniffen?

dde 18. Apr 2005 08:09

Re: Windows Messages sniffen.
 
Ich prog gerad ein Systemtool. Das kann z.B. die versteckten Fenster herausbekommen und bei Bedarf anzeigen. Nun können jedoch mit der Zeit neue Fenster entstehen. Damit der user nicht immer auf ein Refresh-Btn drücken muss, will ich das automatisieren. Wenn ein neues Fenster in der Zwischenzeit existiert, dann soll das Programm dies per Msg mitbekommen und anschließend in die Liste einfügen...

fylo 18. Apr 2005 09:06

Re: Windows Messages sniffen.
 
Hi

ich glaub mit einem Hook sollte sich das machen lassen. Benutze mal die Forumsuche nach Hier im Forum suchenHook

dde 18. Apr 2005 18:18

Re: Windows Messages sniffen.
 
Das war mir schon klar. Welche Messages?

fylo 18. Apr 2005 19:40

Re: Windows Messages sniffen.
 
Hi

in der WinAPI-Help ist folgendes zum SetWindowsHookEx und zum WH_CBT lesen:
Zitat:

HCBT_ACTIVATE
The system is about to activate a window.

HCBT_CLICKSKIPPED
The system has removed a mouse message from the system message queue. Upon receiving this hook code, a CBT application must install a WH_JOURNALPLAYBACK hook procedure in response to the mouse message.

HCBT_CREATEWND
A window is about to be created. The system calls the hook procedure before sending the WM_CREATE or WM_NCCREATE message to the window. If the hook procedure returns a nonzero value, the system destroys the window; the CreateWindow function returns NULL, but the WM_DESTROY message is not sent to the window. If the hook procedure returns zero, the window is created normally.
At the time of the HCBT_CREATEWND notification, the window has been created, but its final size and position may not have been determined and its parent window may not have been established. It is possible to send messages to the newly created window, although it has not yet received WM_NCCREATE or WM_CREATE messages. It is also possible to change the position in the Z order of the newly created window by modifying the hwndInsertAfter member of the CBT_CREATEWND structure.

HCBT_DESTROYWND
A window is about to be destroyed.

HCBT_KEYSKIPPED
The system has removed a keyboard message from the system message queue. Upon receiving this hook code, a CBT application must install a WH_JOURNALPLAYBACK_hook hook procedure in response to the keyboard message.

HCBT_MINMAX
A window is about to be minimized or maximized.

HCBT_MOVESIZE
A window is about to be moved or sized.

HCBT_QS
The system has retrieved a WM_QUEUESYNC message from the system message queue.

HCBT_SETFOCUS
A window is about to receive the keyboard focus.

HCBT_SYSCOMMAND
A system command is about to be carried out. This allows a CBT application to prevent task switching by means of hot keys.

dde 24. Apr 2005 12:23

Re: Windows Messages sniffen.
 
So, ich hab jetzt mal die Messages oben getestet.

HCBT_ACTIVATE wird auch gesendet, wenn die Maus sich bewegt...

HCBT_CREATEWND wird ständig gesendet.

Die bringen mich also nicht weiter, da sie ja irgendwie immer gesendet werden und ich das ja auch mit nem timer bezwecken könnte, was nicht beabsichtigt ist.

Kann man nicht direkt die Messages an den Explorer sniffen?

dde 24. Apr 2005 13:26

Re: Windows Messages sniffen.
 
So ich habs jetzt gelöst. Ich hooke WH_SHELL und filtere nach nCode = HSHELL_WINDOWCREATED und HSHELL_WINDOWDESTROYED.

Arnulf 26. Apr 2005 23:12

Re: Windows Messages sniffen.
 
Hi
kann man soetwas wie WriteProcessMemory auch sniffen?

allerdings von einem anderen programm aus.
in dem sinn so etwas wie CheckRemoteDebuggerPresent ab service pack1 macht.

vielleicht mit wm_debug?

In dem sinn also eine meldung bekommen wenn ein fremdes programm auf ein zu schützendes programm zugreift?

Arnulf

ReDoX 27. Apr 2005 06:09

Re: Windows Messages sniffen.
 
Hi,
WriteProcessMemory kannst du z.B. durch einen API-Hook hooken und immer wenn, WriteProcessMemory aufgerufen wird wird deine Funktion ausgefuehrt.
Mfg ReDoX


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:26 Uhr.
Seite 1 von 3  1 23      

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