Exemple #1
0
        private static void RemoveWndProcUsage(HwndHost hwndHost)
        {
            int refCount = (int)hwndHost.GetValue(WindowHookRefCountProperty);

            refCount--;
            hwndHost.SetValue(WindowHookRefCountProperty, refCount);

            if (refCount == 0)
            {
                HwndHostExtensionsWindowHook hook = (HwndHostExtensionsWindowHook)hwndHost.GetValue(WindowHookProperty);
                hook.Dispose();
                hwndHost.ClearValue(WindowHookProperty);
            }
        }
Exemple #2
0
        private static void AddWndProcUsage(HwndHost hwndHost)
        {
            int refCount = (int)hwndHost.GetValue(WindowHookRefCountProperty);

            refCount++;
            hwndHost.SetValue(WindowHookRefCountProperty, refCount);

            if (refCount == 1)
            {
                if (!TryHookWndProc(hwndHost))
                {
                    // Try again later, when the HwndHost is loaded.
                    hwndHost.Loaded += (s, e) => TryHookWndProc((HwndHost)s);
                }
            }
        }
Exemple #3
0
 /// <summary>
 ///     Attached property getter for the CopyBitsBehavior property.
 /// </summary>
 public static CopyBitsBehavior GetCopyBitsBehavior(this HwndHost @this)
 {
     return((CopyBitsBehavior)@this.GetValue(CopyBitsBehaviorProperty));
 }
Exemple #4
0
 /// <summary>
 ///     Attached property getter for the RaiseMouseActivateCommand property.
 /// </summary>
 public static bool GetRaiseMouseActivateCommand(this HwndHost @this)
 {
     return((bool)@this.GetValue(RaiseMouseActivateCommandProperty));
 }