Could someone direct me to a thread that has any kind of System Wide hook directly in a small program and not a dll. I saw it only one a few years back but none when i tried to do a search today. I just want to be sure that i am doing things right.

I know that this is not the way to go but i need to use it so i can test and see the result for a function in my app again my dll. Nine out of ten i i will go back to the dll but in this case i will know why for myself.

Thanks in advance
Posted on 2003-09-01 20:35:41 by cmax
Posted on 2003-09-03 23:20:54 by P2M
I gave up on trying after wasting 2 days with nothing that works or works to greedy. I think i'll try again.

Thanks P2M
Posted on 2003-09-04 05:39:54 by cmax

Sorry - russian content.

The question by R4DX was: "Why my c-code works but asm-code does not?"
The answer: "because c-code was compiled as debug"
The 2 code by R4DX (with ; ###################### comments) works under 98 but does not under NT-clone. After some research i came to the solution.

Solution: Build exe with relocations (specify /FIXED:NO to the linker) and make your hook-function base-independent. See my attachment It hooks calc.exe and contrary to MSDN says the hook function resides in exe not in the dll. I'm sure it will work sistem-wide too. And remember it fully undocumented. So, now it works but...

Hope this helps.
Posted on 2003-09-05 02:21:19 by Four-F