Mouse Hook: how to access DLL variables inside the callback proc?
Posted on 2007-08-02
I have a DLL for a system-wide mouse hook, so I can capture right mouse clicks. Everything works, but I want to process the normal click (Result := CallNextHookEx(HookHandle, Code, Msg, MouseHook);
) if some condition isn't met.. like if the current active window contains some tittle.
So I forward a string to the DLL, which is received just fine (tested). The problem is I can't access it within the callback proc, it's empty.
How can I access it?
by callback I mean the proc that is defined here:
SetWindowsHookEx(WH_MOUSE, MouseHookCallBack, HInstance, 0)
I have that proc in the DLL, MouseHookCallBack which checks which button was pressed and posts a message to the application using the DLL.