PDA

Click to See Complete Forum and Search --> : WH_CALLWNDPROC hook *RESOLVED!*


jovton
Apr 19th, 2004, 06:30 AM
Hello.

I'm new to C#. I want to implement the WH_CALLWNDPROC hook on local thread. But I don't know how I'm going to cast the System.IntPtr lParam parameter of the CallWndProc function to the CWPDATA structure. If anyone knows what I'm talking about, can you help me out? Thanks.

jovton
Apr 19th, 2004, 03:18 PM
Nevermind. Figured it out meself. :D

public int HookProcedure(int code, IntPtr wParam, IntPtr lParam)
{
CwpStruct newLParam = (CwpStruct) System.Runtime.InteropServices.Marshal.PtrToStructure(lParam, typeof(CwpStruct));

// blah blah blah blah ...

}