Beispiel #1
0
        private void RegHotKey()
        {
            Thread.Sleep(500);
            Application.Current.Dispatcher.Invoke(() =>
            {
                //注册热键,如果注册热键失败则弹出热键设置界面
                hotkeyAtom = HotKeyManager.GlobalAddAtom(hotkeyAtomStr);

                bool status = HotKeyManager.RegisterHotKey(wpfHwnd, hotkeyAtom, config.HotkeyModifier, config.HotkeyKey);
                if (!status)
                {
                    Hotkey_Click(null, null);
                }
            });
        }