Ejemplo n.º 1
0
        private void registerHotKey()
        {
            var helper = new WindowInteropHelper(this);

            if (!WindowsServices.RegisterHotKey(helper.Handle, HOTKEY_ID, WindowsServices.MOD_CTRL | WindowsServices.MOD_WIN | WindowsServices.MOD_ALT, (uint)WindowsServices.Keys.J))
            {
                // handle error
            }
        }
Ejemplo n.º 2
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            var helper = new WindowInteropHelper(this);
            var hwnd   = helper.Handle;

            WindowsServices.SetWindowExTransparent(hwnd);
            source = HwndSource.FromHwnd(hwnd);
            source.AddHook(hwndHook);
            registerHotKey();
        }
Ejemplo n.º 3
0
        private void unregisterHotKey()
        {
            var helper = new WindowInteropHelper(this);

            WindowsServices.UnregisterHotKey(helper.Handle, HOTKEY_ID);
        }