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); }
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 { } } }
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 { } } }
protected void RaiseWindowActivatedEvent(EnvDTE.Window gotFocus, EnvDTE.Window lostFocus) => WindowActivated?.Invoke(gotFocus, lostFocus);
public void OnWindowActivated(Window got, Window lost) { WindowActivated.Invoke(got, lost); }
private static void WindowActivatedEvent(ShellHook ShellObject, IntPtr hWnd) { WindowActivated?.Invoke(ShellObject, hWnd); }
private static void OnWindowActiviated(object sender, EventArgs e) => WindowActivated?.Invoke(sender, e);
private void EditPropertiesFormActivated(object sender, System.EventArgs e) => WindowActivated?.Invoke(this);
private void WindowActivatedEvent(ShellEventHook shellObject, IntPtr hWnd) { WindowActivated?.Invoke(shellObject, hWnd); }
/// <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); }