コード例 #1
0
        private bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state)
        {
            if (keyevent == 256 && vkcode == 68 && state.CtrlPressed && state.AltPressed) // 68 is D
            {
                var    foreGroundWindowPtr = NativeMethods.GetForegroundWindow();
                Window foreGroundWindow    = new Window(foreGroundWindowPtr);

                var quickAccessWindow = new QuickAccessKeywordAssignedWindow(foreGroundWindow);
                quickAccessWindow.ShowDialog();

                return(false);
            }
            return(true);
        }
コード例 #2
0
 public List <Result> ContextMenu()
 {
     return(new List <Result>
     {
         new Result
         {
             Title = "Create Quick Access for this window",
             IcoPath = Main.IconPath,
             Action = _ =>
             {
                 var quickAccessAssign = new QuickAccessKeywordAssignedWindow(this);
                 quickAccessAssign.ShowDialog();
                 return true;
             }
         }
     });
 }