diff --git a/Files.Launcher/Files.Launcher.csproj b/Files.Launcher/Files.Launcher.csproj index 2f953e6ba9bc..53129c6b2c01 100644 --- a/Files.Launcher/Files.Launcher.csproj +++ b/Files.Launcher/Files.Launcher.csproj @@ -27,6 +27,7 @@ 4 8.0 false + false AnyCPU @@ -37,6 +38,7 @@ prompt 4 8.0 + false diff --git a/Files.Launcher/Win32API_ContextMenu.cs b/Files.Launcher/Win32API_ContextMenu.cs index 46e0f4c20acc..66e9fc5b67d9 100644 --- a/Files.Launcher/Win32API_ContextMenu.cs +++ b/Files.Launcher/Win32API_ContextMenu.cs @@ -288,6 +288,12 @@ private static void EnumMenuItems( private static string GetCommandString(Shell32.IContextMenu cMenu, uint offset, Shell32.GCS flags = Shell32.GCS.GCS_VERBW) { + if (offset > 5000) + { + // Hackish workaround to avoid an AccessViolationException on some items, + // notably the "Run with graphic processor" menu item of NVidia cards + return null; + } SafeCoTaskMemString commandString = null; try {