Jump to content
Sign in to follow this  
KaFu

Windows Message Hooking

Recommended Posts

KaFu

HiHo Board,

looking for the most recent release of prospeed.dll I found this message.dll

MessageDll.zip

for window message hooking here

http://frabbing.bplaced.net/_message.html

Now I'm trying to figure out the dll call :huggles:, not yet successfully :D. Example is based on the sample-source files in the zip. Appreciate any help :...

; http://frabbing.bplaced.net/_message.html

$hDLL_Message = DllOpen("Message.dll")

Run("Notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")

DllCall($hDLL_Message, "hwnd", "InitMessages", "hwnd", $hWnd)

#cs
http://msdn.microsoft.com/en-us/library/ms644958%28VS.85%29.aspx
typedef struct {
    HWND hwnd;
    UINT message;
    WPARAM wParam;
    LPARAM lParam;
    DWORD time;
    POINT pt;
} MSG, *PMSG;

http://msdn.microsoft.com/en-us/library/8kk2sy33%28VS.71%29.aspx
typedef struct tagPOINT {
   LONG x;
   LONG y;
} POINT;
#ce

#cs
$tStrut_PT = DllStructCreate("long;long;")
$tStrut_MSG = DllStructCreate("HWND;UINT;wParam;lParam;DWORD;ptr;")
DllStructSetData($tStrut_MSG,6,DllStructGetPtr($tStrut_PT))
#ce

$tStrut_MSG = DllStructCreate("byte[20];")

While Sleep(10)
    $aRet = DllCall($hDLL_Message, "hwnd", "GetNewMessages", "ptr", DllStructGetPtr($tStrut_MSG))
    ConsoleWrite($aRet[0] & @tab & DllStructGetData($tStrut_MSG, 1) & @CRLF)
    ;ConsoleWrite($aRet[0] & @tab & DllStructGetData($tStrut_MSG, 1) & @tab & DllStructGetData($tStrut_MSG, 1) & @tab & DllStructGetData($tStrut_MSG, 1) & @CRLF)
    if not WinExists($hWnd) then ExitLoop
WEnd

ConsoleWrite("-Exit" & @crlf)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.