Jump to content

Windows Message Hooking


KaFu
 Share

Recommended Posts

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)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...