Skip to content

Commit

Permalink
CallWindowProc belongs into PInvokeHooks, not PInvokeHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ade committed Feb 28, 2017
1 parent f1d762c commit ba89104
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Helper/PInvokeHooks/PInvokeHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ public static IntPtr CallWindowHook(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr
return (IntPtr) form.WindowHook.DynamicInvoke(hWnd, Msg, wParam, lParam);
}

public static IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam) {
if (lpPrevWndFunc == IntPtr.Zero)
return IntPtr.Zero;
return (IntPtr) Marshal.GetDelegateForFunctionPointer(lpPrevWndFunc, typeof(MulticastDelegate))
.DynamicInvoke(hWnd, Msg, wParam, lParam);
}
}

public static partial class PInvokeHooks {
Expand All @@ -132,6 +126,13 @@ public static int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong) {
return 0;
}

public static IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam) {
if (lpPrevWndFunc == IntPtr.Zero)
return IntPtr.Zero;
return (IntPtr) Marshal.GetDelegateForFunctionPointer(lpPrevWndFunc, typeof(MulticastDelegate))
.DynamicInvoke(hWnd, Msg, wParam, lParam);
}

public static IntPtr SetWindowsHookEx(HookType hookType, HookProc lpfn, IntPtr hMod, uint dwThreadId) {
// TODO SetWindowsHookEx currently ignores the module and thread.
int handle = PInvokeHelper.AllHooks.Count + 1;
Expand Down

0 comments on commit ba89104

Please # to comment.