コード例 #1
0
ファイル: Program.cs プロジェクト: rzhukov/VolumeControl
        static void SetupHotkeys()
        {
            _VolUpHook = new KeyboardHook();
            _VolUpHook.SetKeys(new KeyCombination(KeysEx.F12 | KeysEx.WinLogo));
            _VolUpHook.AutoRepeat = true;

            _VolUpHook.Pressed += new EventHandler(_VolUpHook_Hooked);

            _VolUpHook.Engage();

            _VolDownHook = new KeyboardHook();
            _VolDownHook.SetKeys(new KeyCombination(KeysEx.F11 | KeysEx.WinLogo));
            _VolDownHook.AutoRepeat = true;

            _VolDownHook.Pressed += new EventHandler(_VolDownHook_Pressed);

            _VolDownHook.Engage();

            _VolMuteHook = new KeyboardHook();
            _VolMuteHook.SetKeys(new KeyCombination(KeysEx.F10 | KeysEx.WinLogo));
            _VolMuteHook.AutoRepeat = true;

            _VolMuteHook.Pressed += new EventHandler(_VolMuteHook_Pressed);

            _VolMuteHook.Engage();
        }