Exemplo n.º 1
0
        protected override IntPtr OnHook(int code, IntPtr wparam, IntPtr lparam)
        {
            switch (code)
            {
                case (int)WindowHookCode.Activate:
                    WindowActivatingEventArgs args = new WindowActivatingEventArgs(new Window(wparam));

                    this.OnActivating(args);

                    if (args.Cancel)
                    {
                        return new IntPtr(1);
                    }

                    return IntPtr.Zero;

                default:
                    return base.OnHook(code, wparam, lparam);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Raises the <see cref="Activating"/> event.
 /// </summary>
 /// <param name="e">The <see cref="T:SmartCore.Interop.Windows.WindowActivatingEventArgs"/> instance containing the event data.</param>
 protected virtual void OnActivating(WindowActivatingEventArgs e)
 {
     if (Activating != null)
         Activating(this, e);
 }