protected override void WndProc(ref Message m)
        {
            if (m.Msg == _wmShellHook)
            {
                switch ((EnumShellEvents)m.WParam)
                {
                case EnumShellEvents.HSHELL_WINDOWCREATED:
                    if (IsAppWindow(m.LParam))
                    {
                        OnWindowCreated(m.LParam);
                    }

                    break;

                case EnumShellEvents.HSHELL_WINDOWDESTROYED:
                    WindowDestroyed?.Invoke(this, m.LParam);
                    break;

                case EnumShellEvents.HSHELL_WINDOWACTIVATED:
                    WindowActivated?.Invoke(this, m.LParam);
                    break;
                }
            }
            base.WndProc(ref m);
        }
Ejemplo n.º 2
0
            protected override void WndProc(ref Message m)
            {
                if (m.Msg == message)
                {
                    var type = (WinAPI.ShellHook)m.WParam;
                    switch (type)
                    {
                    case WinAPI.ShellHook.Activate:
                    case WinAPI.ShellHook.RudeActivate:
                        WindowActivated?.Invoke(GetWindow(m.LParam));
                        break;

                    case WinAPI.ShellHook.Create:
                        WindowCreated?.Invoke(GetWindow(m.LParam));
                        break;

                    case WinAPI.ShellHook.Destroy:
                        WindowDestroyed?.Invoke(GetWindow(m.LParam));
                        break;

                    case WinAPI.ShellHook.Flash:
                        WindowFlashed?.Invoke(GetWindow(m.LParam));
                        break;

                    case WinAPI.ShellHook.Redraw:
                        WindowRedraw?.Invoke(GetWindow(m.LParam));
                        break;
                    }
                }

                base.WndProc(ref m);
            }
 void fireWindowActivatedEvent(OoWindowEventArgs e)
 {
     if (WindowActivated != null)
     {
         try { WindowActivated.Invoke(this, e); }
         catch { }
     }
 }
Ejemplo n.º 4
0
 private void fireWindowActivatedEvent(unoidl.com.sun.star.lang.EventObject source)
 {
     if (WindowActivated != null)
     {
         try
         {
             WindowActivated.DynamicInvoke(this, new OoEventArgs(source));
         }
         catch (Exception ex) { Logger.Instance.Log(LogPriority.DEBUG, this, "can't fire window activated event", ex); }
     }
 }
 void fireWindowActivatedEvent(unoidl.com.sun.star.lang.EventObject Source)
 {
     if (WindowActivated != null)
     {
         try
         {
             WindowActivated.Invoke(this, new EventObjectForwarder(Source));
         }
         catch { }
     }
 }
Ejemplo n.º 6
0
 protected void RaiseWindowActivatedEvent(EnvDTE.Window gotFocus, EnvDTE.Window lostFocus) =>
 WindowActivated?.Invoke(gotFocus, lostFocus);
Ejemplo n.º 7
0
 public void OnWindowActivated(Window got, Window lost)
 {
     WindowActivated.Invoke(got, lost);
 }
Ejemplo n.º 8
0
 private static void WindowActivatedEvent(ShellHook ShellObject, IntPtr hWnd)
 {
     WindowActivated?.Invoke(ShellObject, hWnd);
 }
Ejemplo n.º 9
0
 private static void OnWindowActiviated(object sender, EventArgs e) => WindowActivated?.Invoke(sender, e);
Ejemplo n.º 10
0
 private void EditPropertiesFormActivated(object sender, System.EventArgs e) => WindowActivated?.Invoke(this);
Ejemplo n.º 11
0
 private void WindowActivatedEvent(ShellEventHook shellObject, IntPtr hWnd)
 {
     WindowActivated?.Invoke(shellObject, hWnd);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Raises the <see cref="WindowActivated"/> event.
 /// </summary>
 /// <param name="eventArgs">
 /// <see cref="EventArgs"/> object that provides the arguments for the event.
 /// </param>
 /// <remarks>
 /// <strong>Notes to Inheritors:</strong><br/> When overriding
 /// <see cref="OnWindowActivated"/> in a derived class, be sure to call the base class's
 /// <see cref="OnWindowActivated"/> method so that registered delegates receive the event.
 /// </remarks>
 protected virtual void OnWindowActivated(EventArgs eventArgs)
 {
     WindowActivated?.Invoke(this, eventArgs);
 }