NickeManarin/ScreenToGif · error · Exception

Windows 8 or newer is required for capturing the screen usin

Error message

Windows 8 or newer is required for capturing the screen using the Desktop Duplication API.

What it means

PrepareCapture throws when the user enabled Desktop Duplication (UserSettings.All.UseDesktopDuplication) but OperationalSystemHelper.IsWin8OrHigher() returns false. The Desktop Duplication API (DXGI 1.2+) requires Windows 8 or newer, so on Win7/Vista the recorder refuses to start rather than failing mid-capture.

Source

Thrown at ScreenToGif/Windows/NewRecorder.xaml.cs:1411

    }

    private async Task PrepareCapture(bool isNew = true)
    {
        if (isNew && Capture != null)
        {
            await Capture.DisposeAsync();
            Capture = null;
        }

        //If the capture helper was initialized already, ignore this.
        if (Capture != null)
            return;

        if (UserSettings.All.UseDesktopDuplication)
        {
            //Check if Windows 8 or newer.
            if (!OperationalSystemHelper.IsWin8OrHigher())
                throw new Exception(LocalizationHelper.Get("S.Recorder.Warning.Windows8"));

            Capture = GetDirectCapture();
            Capture.DeviceName = _viewModel.CurrentMonitor.Name;
            _viewModel.IsDirectMode = true;
        }
        else
        {
            //Capture with BitBlt.
            Capture = UserSettings.All.UseMemoryCache ? new CachedCapture() : new ImageCapture();

            _viewModel.IsDirectMode = false;
        }

        Capture.OnError += exception =>
        {
            //Pause the recording and show the error.
            _viewModel.PauseCommand.Execute(null, null);

View on GitHub (pinned to a4d0a67c21)

Solutions

  1. Disable 'Use Desktop Duplication API' in Options > Capture to fall back to BitBlt (works on Win7).
  2. Upgrade to Windows 8 / 10 / 11 to use Desktop Duplication.
  3. Confirm the app.manifest declares a compatible OS GUID so Environment.OSVersion reports accurately.
  4. If the OS really is modern but the check fails, file a bug against OperationalSystemHelper.IsWin8OrHigher.

Example fix

// before
if (UserSettings.All.UseDesktopDuplication)
{
    if (!OperationalSystemHelper.IsWin8OrHigher())
        throw new Exception(LocalizationHelper.Get("S.Recorder.Warning.Windows8"));
    Capture = GetDirectCapture();
    ...
}

// after
if (UserSettings.All.UseDesktopDuplication)
{
    if (!OperationalSystemHelper.IsWin8OrHigher())
        throw new Exception(LocalizationHelper.Get("S.Recorder.Warning.Windows8") + " Disable 'Use Desktop Duplication API' to fall back to BitBlt capture.");
    Capture = GetDirectCapture();
    ...
}
Defensive patterns

Strategy: validation

Validate before calling

if (UserSettings.All.UseDesktopDuplication && !OperationalSystemHelper.IsWin8OrHigher())
{
    UserSettings.All.UseDesktopDuplication = false; // fall back to BitBlt
    // warn user: DDU requires Windows 8+
}

Type guard

static bool DduIsSupported => OperationalSystemHelper.IsWin8OrHigher();

Try / catch

try { await PrepareCapture(); }
catch (Exception ex) when (ex.Message == LocalizationHelper.Get("S.Recorder.Warning.Windows8"))
{ /* disable DDU, retry with BitBlt */ }

Prevention

When it happens

Trigger: UserSettings.All.UseDesktopDuplication == true AND OperationalSystemHelper.IsWin8OrHigher() == false (Environment.OSVersion reports < 6.2).

Common situations: Windows 7 / Vista user who enabled the DDU option; VM or compatibility shim reporting an older OS version; app manifest not declaring Windows 10/11 compatibility so OSVersion lies.

Related errors


AI-assisted analysis of NickeManarin/ScreenToGif@a4d0a67c21 (2026-08-13). Data as JSON: /api/errors/f804bba791b16bf4. Report an issue: GitHub.