开发者

Intercept WindowsKey + L (Lock) keypress in C#?

开发者 https://www.devze.com 2023-02-10 13:09 出处:网络
Is it possible to intercept the WindowsKey + L (The short cut to lock the console) from a running application?

Is it possible to intercept the WindowsKey + L (The short cut to lock the console) from a running application?

I've got an app that needs to catch that and display a custom window for about 5 seconds, then allow the lock to go through.

Can I do this in natively in c#? If 开发者_开发技巧not, can I do this with some sort of Windows API?

Thanks in advance


It's definitely doable, but I'm afraid you need to pinvoke:

SetWindowsHookEx

LowLevelKeyboardProc

GetAsyncKeyState could be relevant, too

0

精彩评论

暂无评论...
验证码 换一张
取 消