I have a hook that taps into the WndProc function of the program that loads my DLL. Works great for programs that dont use Hooks in thier code.
Now im loading my DLL from inside Firefox and it works great....for about 5 mins. Turns out thier code also hooks into the WndProc function. Could thier hook be overwriting my hook and thats why it dies after 5 mins?
According to MSDN the first value of CallNextHookEx() is ignored but yet people pass things into it. Does it really matter?? or since im hooking into the WndProc, should i be calling something else other then CallNextHookEx()??
Here is the code that i use:
HookedWndProc = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC) DllProc, Inst, ThreadID);
LRESULT CALLBACK DllProc(int uMsg, WPARAM wParam, LPARAM lParam)
.........CODE GOES HERE...........
return CallNextHookEx(HookedWndProc, uMsg, wParam, lParam);