Is there a way to way set process security permissions or some other way to disable Windows from loading global window hook dlls? I don't want to disable SetWindowsHookEx, I just want to disable the hook dll from loading in my process.
You might be able to disable all hooks by installing your own hook and then not calling CallNextHookEx()
from your hook. To do this correctly you will want to make sure that your hook will be the first hook that's going to be called.
The order the hooks are being called doesn't seem to be documented but it's easy enough to check by trial and error. Just install several hooks from different processes and see which is called first. The most likely cases are
This solution is far from perfect and, considering that the order is not documented, it may conceivably change at some point in the future. it is also possible that the hook invocation order is completely random, in which case this solution will not do you much good.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.