在c#中动态注册热键的最佳方法是什么? [英] Best way to register hotkey dynamically in c#?

查看:92
本文介绍了在c#中动态注册热键的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i我正在开发一个服务器客户端(客户端可能是多个)应用程序,其中服务器应用程序应具有切换客户端控件的功能,我需要定义一些热键,如'Ctrl +第一个客户端为1',第二个客户端为Ctrl + 2,依此类推。为此,每次将新客户端连接到服务器时,我都必须注册一个新的热键。



我的问题:是否可以将Ctrl + 11注册为全局热键?如果是,那么如何?

解决方案

是的。请参阅此文章: http://www.liensberger.it/web/blog/?p=207 [ ^ ]。



-SA


CodeProject上用于创建全局Windows挂钩的大量资源:[ ^ ]。

Hi,
i am developing a server-client (client may be multiple ) application, in which server app should have functionality to switch controls over client for i need to define some hotkey like 'Ctrl + 1' for first client, 'Ctrl + 2' for second client and so on. For this i have to register a new hotkey every time when a new client is connected to the server.

My question : Is it possible to register 'Ctrl + 11' as a global hotkey? If yes then how?

解决方案

Yes. Please see this article: http://www.liensberger.it/web/blog/?p=207[^].

—SA


Lots of resources on CodeProject for creating Global Windows Hooks: [^].


这篇关于在c#中动态注册热键的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆