Thread: Weird Hook Problem.

  1. #1
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195

    Weird Hook Problem.

    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:

    Code:
    ...........
    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); 
    }
    Last edited by Mastadex; 06-22-2006 at 12:28 PM.
    Founder and avid member of the Internationsl Typo Associateion

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. weird problem!
    By spank in forum C Programming
    Replies: 2
    Last Post: 04-08-2006, 03:26 AM
  2. very weird problem (pointers I think)
    By hannibar in forum C Programming
    Replies: 2
    Last Post: 10-11-2005, 06:45 AM
  3. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  4. Replies: 6
    Last Post: 05-12-2005, 03:39 AM
  5. Weird class problem!
    By aker_y3k in forum C++ Programming
    Replies: 2
    Last Post: 09-25-2002, 06:12 AM