AdvancedLauncher.Tools.Extensions.HwndHostExtensions.AddWndProcUsage C# (CSharp) Метод

AddWndProcUsage() приватный статический Метод

private static AddWndProcUsage ( System.Windows.Interop.HwndHost hwndHost ) : void
hwndHost System.Windows.Interop.HwndHost
Результат void
        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);
                }
            }
        }