I have created a DLL that should monitor the WndProc of the app that loaded it. I use the following code to hook into the WndProc:
HookedWndProc = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC) DllProc, NULL, ThreadID);
LRESULT CALLBACK DllProc(HWND Hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return CallNextHookEx(NULL, uMsg, wParam, lParam);
The ThreadID is the ID of the app's thread. i use GetCurrentThreadId() in order to get the ID of my thread. I did not execute this function call in the DLL itself, its in the app.
The problem is that my DllProc function is not recieving the messages I want it to recieve, mainly WM_COPYDATA. the WndProc in my main app recieves these messages fine.
Cany anyone shed some insight on why this isnt working for me?? Thnx