Most people familiar with system-wide hooks will be skeptical of your motivation. My guess is that in this case, there is ample justification for being suspicious.
It took me a couple of months to get a system-wide hook to work. I studied everything I could find, and I did spend time searching. There are more resources available now compared to when I was looking. There are now a couple or more samples that did not exist then.
I could post a sample myself, but I won't because the code is simple if the knowledge required for the sample exists. A system-wide hook is something that can cause problems, and anyone using sample code that does not adequately understand Windows can easily cause problems.
If you are developing a system-wide hook, then you need to understand DLLs. If you don't, then learn about them. Another critical concept to understand is Address Spaces; see my Processes and Address Spaces.
Actually, for a keyboard system-wide hook, it might not be necessary to create a DLL. You can look at documentation and such; I forget where I read it, but a keyboard system-wide hook might be different from other system-wide hooks in that it might not be necessary to have them in a DLL and if so then the concept of address spaces might not be relevant.
Additional questions, though, should be asked in an appropriate newsgroup or forum.
|