System-Wide Hook - Example? (WH_CBT)
Do you think anyone could give me a System-Wide hook example? (Like a WH_CBT)
I already know how to implement WH_Keyboard_LL and WH_Mouse_LL since these do not require DLL injection, but all the other do via the SetWindowsHookEx. (I think it is because they are LowLevel that it allows for no DLL, would have been nice if MS did this for every hook)
I could attempt to code the DLL in C++ but I dont know too much about it, and feel somewhat insecure about building a dll that is going to be injected into every process that has the posibility of failing to properly work. So I am wondering if anyone has any good examples, or knows of sites with good examples that will allow the code to be managed in the VB application itself, or in a VB6 DLL (modified of course since vb6 only supports ActiveX by default).
I want to avoid having to recompile a new C++ dll everytime I need to change the code slightly to handle a different window message.
So can anyone help, give any tips, or point to any sites?
Thanks.
-Alt
Re: System-Wide Hook - Example? (WH_CBT)
Yes, the best thing is to use moeur's ocx control and the dll in your vb program. i use it personaly and rocking.
But not sure it support WH_CBT. Any way have a look at it.
http://www.vbforums.com/showthread.php?t=322261
The attachments contain Documentation, examples, compiled dll and the ocx file that are need to distribute with your project. Just add the ActiveX control by browsing to the ocx file and set it's properties. thats all.
Re: System-Wide Hook - Example? (WH_CBT)
Well I guess it is a good start, although I see it does not support CBT.
I will keep looking around though.