With SetWindowsHookEx() you can either specify a dll in hMod and use 0 for dwThreadId which gives you a system wide hook, or you use NULL for hMod and specify your programs thread id in dwThreadId to hook your program.
Now if i happen to have a thread id for another program can i create a hook which will only hook that program. I have tried a couple versions of SetWindowsHookEx() with and without a dll but i cant get it to work yet, has anyone done this before?