private void Close(TimeSpan fadeoutDuration)
 {
     _physicalInstance?.Close(fadeoutDuration);
     _physicalInstance           = null;
     _splashScreenCloseRequested = true;
     _adapterInstance            = null;
 }
        internal SplashScreenAdapter([NotNull] string splashBitmapResourceName, double minimumVisibilityDuration, double fadeoutDuration)
        {
            _minimumVisibilityDuration = minimumVisibilityDuration;
            _fadeoutDuration           = fadeoutDuration;

            _physicalInstance = new SplashScreen(splashBitmapResourceName);
            _physicalInstance.Show(false);

            var hWndSplash = NativeMethods.GetActiveWindow();

            NativeMethods.SetWindowPos(hWndSplash, (IntPtr)HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
            NativeMethods.SetActiveWindow(IntPtr.Zero);

            Hook.HookWindow(hWndSplash);

            _timer.Tick += Timer_Tick;
            _timer.Start();

            NativeMethods.SetActiveWindow(IntPtr.Zero);

            _adapterInstance = this;
        }