{"record":{"id":"f804bba791b16bf4","repo":"NickeManarin/ScreenToGif","slug":"windows-8-or-newer-is-required-for-capturing-the-s","errorCode":null,"errorMessage":"Windows 8 or newer is required for capturing the screen using the Desktop Duplication API.","messagePattern":"Windows 8 or newer is required for capturing the screen using the Desktop Duplication API\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"ScreenToGif/Windows/NewRecorder.xaml.cs","lineNumber":1411,"sourceCode":"    }\n\n    private async Task PrepareCapture(bool isNew = true)\n    {\n        if (isNew && Capture != null)\n        {\n            await Capture.DisposeAsync();\n            Capture = null;\n        }\n\n        //If the capture helper was initialized already, ignore this.\n        if (Capture != null)\n            return;\n\n        if (UserSettings.All.UseDesktopDuplication)\n        {\n            //Check if Windows 8 or newer.\n            if (!OperationalSystemHelper.IsWin8OrHigher())\n                throw new Exception(LocalizationHelper.Get(\"S.Recorder.Warning.Windows8\"));\n\n            Capture = GetDirectCapture();\n            Capture.DeviceName = _viewModel.CurrentMonitor.Name;\n            _viewModel.IsDirectMode = true;\n        }\n        else\n        {\n            //Capture with BitBlt.\n            Capture = UserSettings.All.UseMemoryCache ? new CachedCapture() : new ImageCapture();\n\n            _viewModel.IsDirectMode = false;\n        }\n\n        Capture.OnError += exception =>\n        {\n            //Pause the recording and show the error.\n            _viewModel.PauseCommand.Execute(null, null);\n","sourceCodeStart":1393,"sourceCodeEnd":1429,"githubUrl":"https://github.com/NickeManarin/ScreenToGif/blob/a4d0a67c2131cd048ceec86cd40afc2f1a06f2fd/ScreenToGif/Windows/NewRecorder.xaml.cs#L1393-L1429","documentation":"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.","triggerScenarios":"UserSettings.All.UseDesktopDuplication == true AND OperationalSystemHelper.IsWin8OrHigher() == false (Environment.OSVersion reports < 6.2).","commonSituations":"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.","solutions":["Disable 'Use Desktop Duplication API' in Options > Capture to fall back to BitBlt (works on Win7).","Upgrade to Windows 8 / 10 / 11 to use Desktop Duplication.","Confirm the app.manifest declares a compatible OS GUID so Environment.OSVersion reports accurately.","If the OS really is modern but the check fails, file a bug against OperationalSystemHelper.IsWin8OrHigher."],"exampleFix":"// before\nif (UserSettings.All.UseDesktopDuplication)\n{\n    if (!OperationalSystemHelper.IsWin8OrHigher())\n        throw new Exception(LocalizationHelper.Get(\"S.Recorder.Warning.Windows8\"));\n    Capture = GetDirectCapture();\n    ...\n}\n\n// after\nif (UserSettings.All.UseDesktopDuplication)\n{\n    if (!OperationalSystemHelper.IsWin8OrHigher())\n        throw new Exception(LocalizationHelper.Get(\"S.Recorder.Warning.Windows8\") + \" Disable 'Use Desktop Duplication API' to fall back to BitBlt capture.\");\n    Capture = GetDirectCapture();\n    ...\n}","handlingStrategy":"validation","validationCode":"if (UserSettings.All.UseDesktopDuplication && !OperationalSystemHelper.IsWin8OrHigher())\n{\n    UserSettings.All.UseDesktopDuplication = false; // fall back to BitBlt\n    // warn user: DDU requires Windows 8+\n}","typeGuard":"static bool DduIsSupported => OperationalSystemHelper.IsWin8OrHigher();","tryCatchPattern":"try { await PrepareCapture(); }\ncatch (Exception ex) when (ex.Message == LocalizationHelper.Get(\"S.Recorder.Warning.Windows8\"))\n{ /* disable DDU, retry with BitBlt */ }","preventionTips":["Hide the 'Use Desktop Duplication API' toggle on OSes below Windows 8.","Declare Windows 10/11 compatibility in app.manifest so OSVersion reports truthfully.","Auto-fall back to BitBlt when the OS check fails."],"tags":["desktop-duplication","os-version","capture","windows","configuration"],"backgroundTag":null,"analyzedSha":"a4d0a67c2131cd048ceec86cd40afc2f1a06f2fd","analyzedAt":"2026-08-13T11:12:06.147Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}