private void OnMove(MouseHookEventArgs e)
        {
            if (Svc.SM.UI.ElementWdw.IsAvailable)
            {
                IntPtr SMElementWdw  = Svc.SM.UI.ElementWdw.Handle;
                IntPtr ForegroundWdw = Natives.GetForegroundWindow();

                if (SMElementWdw == ForegroundWdw)
                {
                    Move?.Invoke(this, e);
                }
            }
        }
 /// <summary>
 ///     This is the callback method that is called whenever a low level mouse event is triggered.
 ///     We use it to call our individual custom events.
 /// </summary>
 private IntPtr MouseHookCallback(int nCode, IntPtr wParam, IntPtr lParam)
 {
     if (nCode >= 0)
     {
         var lParamStruct = (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT));
         var e            = new MouseHookEventArgs(lParamStruct);
         switch ((MouseMessages)wParam)
         {
         case MouseMessages.WmMouseMove:
             TriggerMouseEvent(e, MouseEventNames.MouseMove, OnMove);
             break;
         }
     }
     return((IntPtr)Natives.CallNextHookEx(_hookId, nCode, wParam, lParam));
 }
 private static void TriggerMouseEvent(MouseHookEventArgs e, MouseEventNames name,
                                       Action <MouseHookEventArgs> method)
 {
     e.MouseEventName = name;
     method(e);
 }