//注销热键 private void cancelHotKey() { foreach (var hotk in RegisteredHotKey) { AppHotKey.UnRegKey(Handle, hotk); } }
//注册热键 private void registerHotKey() { RegisteredHotKey.Clear(); foreach (var hotk in sysParam.hotKeyDatas) { string res = AppHotKey.RegKey(Handle, int.Parse(hotk.Value.hotKeyCode), 0, (Keys)int.Parse(hotk.Value.hotKeyCode)); Console.WriteLine(res); RegisteredHotKey.Add(int.Parse(hotk.Value.hotKeyCode)); } }