I have

hook = SetWindowsHookEx(WH_MOUSE, &Proc, NULL, ThreadID);   

Proc is the standard hook proc:

public extern (Windows) LRESULT Proc(int code, WPARAM wParam, LPARAM lParam)

I get a type mismatch because Proc is a delegate and SetWindowsHookEx expects a function. Making proc static works but not the behavior I want since all this stuff is wrapped in a class.

Is there any way to pass Proc to SetWindowsHookEx without issues of GB and such?



Error: function windows.winuser.SetWindowsHookExA (int, extern (Windows) int function(int, uint, int), void*, uint) is not callable using argument types (const(int), extern (Windows) int delegate(int code, uint wParam, int lParam), void*, uint)

I could cast Proc to a function, obviously, but I'll loose the delegate behavior and create problems when I try to use this inside Proc?


Reply via email to