walterlv / BlogComments

3 stars 0 forks source link

post/add-global-windows-hook-in-dotnet #91

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

.NET/C# 使用 SetWindowsHookEx 监听鼠标或键盘消息以及此方法的坑 - walterlv

.NET/C# 使用 SetWindowsHookEx 监听鼠标或键盘消息以及此方法的坑

https://blog.walterlv.com/post/add-global-windows-hook-in-dotnet.html

pluveto commented 3 years ago

遇到了挂载后导致资源管理器崩溃的问题,解决方法: https://stackoverflow.com/questions/56987267/explorer-exe-crashes-when-global-touch-hook-via-wh-getmessage-is-enabled

walterlv commented 2 years ago

@pluveto 感谢指导!

Violet-VE commented 3 months ago

假设我在HookProc内return 1阻断了某个键(比如Win键), 然后我在开始的时候注册了一个全局热键(比如Win键), 那么这时候WndProc是不是会接收不到消息?应该如何解决?是否只能在按键被阻断之前进行处理(HookProc内, return 1之前)?