예제 #1
0
        public static string Init()
        {
            var tipMsg = string.Empty;

            try
            {
                HotKeyHelper.RegisterDownKey();
                Keys keys;
                if (Params.HotKey.GetHotKey(HotKeyHelper.HotOp.QinKong, out keys) && !HotKeyHelper.Register(keys, HotKeyHelper.HotOp.QinKong))
                {
                    tipMsg += "清空,";
                }
                if (Params.HotKey.GetHotKey(HotKeyHelper.HotOp.ZhiSi, out keys) && !HotKeyHelper.Register(keys, HotKeyHelper.HotOp.ZhiSi))
                {
                    tipMsg += "知识,";
                }
                if (tipMsg.Length > 0)
                {
                    tipMsg = tipMsg.Substring(0, tipMsg.Length - 1);
                    tipMsg = string.Format("“{0}”等功能的“快捷键”失效,原因是这些快捷键已经被其它程序占用。", tipMsg);
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
                tipMsg += ex.Message;
            }
            return(tipMsg);
        }