摘要: 在c#中使用全局快捷键由于.net并没有提供快捷键的库,所以要使用该功能得通过api实现。在winapi中,注册和注销全局快捷键分别是通过RegisterHotKey和UnregisterHotKey函数实现。在c#中直接使用该api显得不够简洁,这里我提供了一个友好点的封装。代码如下:staticclassHotkey{系统api#region系统api[DllImport("user32.dll")][return:MarshalAs(UnmanagedType.Bool)]staticexternboolRegisterHotKey(IntPtrhWnd,intid, 阅读全文
posted @ 2007-05-14 10:38 天方 阅读(6143) 评论(12) 推荐(2) 编辑