SetWindowsHookEx and clicking minimize/maximize/close buttons on form freezing

那年仲夏 提交于 2019-12-04 19:27:34
Luca

You need an handle to a native module. Don't expect that this will work as a global hook: your hook implementation requires the .NET JIT to be executed!

Indeed every non-managed process will fail to execute your handler! I suppose that this is the reason of the system block.

...

After re-reading your code it seems you don't want a global hook ('this' has no meanng in other processes). So, RTFM of SetWindowsHookEx and set the last argument appropriately.

For reference, I suggest an old question of mine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!