Skip to content

Commit ed4c0bb

Browse files
authored
Fixed and issue with the context menu not appearing when right clicking on exe files (#1945)
1 parent 99b05ab commit ed4c0bb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Files.Launcher/Files.Launcher.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<WarningLevel>4</WarningLevel>
2828
<LangVersion>8.0</LangVersion>
2929
<UseVSHostingProcess>false</UseVSHostingProcess>
30+
<Prefer32Bit>false</Prefer32Bit>
3031
</PropertyGroup>
3132
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3233
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -37,6 +38,7 @@
3738
<ErrorReport>prompt</ErrorReport>
3839
<WarningLevel>4</WarningLevel>
3940
<LangVersion>8.0</LangVersion>
41+
<Prefer32Bit>false</Prefer32Bit>
4042
</PropertyGroup>
4143
<PropertyGroup>
4244
<StartupObject />

Files.Launcher/Win32API_ContextMenu.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ private static void EnumMenuItems(
288288

289289
private static string GetCommandString(Shell32.IContextMenu cMenu, uint offset, Shell32.GCS flags = Shell32.GCS.GCS_VERBW)
290290
{
291+
if (offset > 5000)
292+
{
293+
// Hackish workaround to avoid an AccessViolationException on some items,
294+
// notably the "Run with graphic processor" menu item of NVidia cards
295+
return null;
296+
}
291297
SafeCoTaskMemString commandString = null;
292298
try
293299
{

0 commit comments

Comments
 (0)