Skip to content
This repository was archived by the owner on Nov 15, 2025. It is now read-only.

Commit 60626f8

Browse files
authored
0.10 Beta Bugfix (Win11 OSD & Lock keys) (#1205)
* Updated the toolkit Microsoft deprecated the old toolkit and released the same thing under a new name. * Update ModernFlyouts.Package.wapproj * Update README.md * Adds Windows 11 Support for hiding the volume OSD Changes the class that is being searched for depending on the build number. * Revert "Update README.md" This reverts commit 381e623. * Reverting the name back to normal I changed it to avoid interfering with normal builds.
1 parent fc78d2d commit 60626f8

26 files changed

+191
-183
lines changed

ModernFlyouts.Core/Display/BrightnessController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Management;
3-
using Microsoft.Toolkit.Mvvm.ComponentModel;
3+
using CommunityToolkit.Mvvm.ComponentModel;
44
using ModernFlyouts.Core.Interop;
55

66
namespace ModernFlyouts.Core.Display

ModernFlyouts.Core/Display/DisplayManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Toolkit.Mvvm.ComponentModel;
1+
using CommunityToolkit.Mvvm.ComponentModel;
22
using ModernFlyouts.Core.Interop;
33
using System;
44
using System.Collections.Generic;

ModernFlyouts.Core/Display/DisplayMonitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Toolkit.Mvvm.ComponentModel;
1+
using CommunityToolkit.Mvvm.ComponentModel;
22
using System;
33
using System.Windows;
44

ModernFlyouts.Core/Interop/NativeFlyoutHandler.cs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Diagnostics;
33
using System.Linq;
4+
using System.Runtime.InteropServices;
5+
using System.Windows.Interop;
46
using System.Windows.Threading;
57
using static ModernFlyouts.Core.Interop.NativeMethods;
68

@@ -340,11 +342,31 @@ private static bool IsShellProcess(int id)
340342

341343
private bool GetAllInfos()
342344
{
343-
IntPtr hWndHost;
344-
while ((hWndHost = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "NativeHWNDHost", "")) != IntPtr.Zero)
345+
IntPtr hWndHost = IntPtr.Zero;
346+
IntPtr hWndDUI = IntPtr.Zero;
347+
348+
String build = RuntimeInformation.OSDescription.Substring(RuntimeInformation.OSDescription.LastIndexOf('.') + 1);
349+
int buildNumber = int.Parse(build);
350+
351+
String outerClass = "";
352+
String outerName = "";
353+
String innerClass = "";
354+
String innerName = "";
355+
if (buildNumber >= 22000)
356+
{
357+
outerClass = "XamlExplorerHostIslandWindow";
358+
innerClass = "Windows.UI.Composition.DesktopWindowContentBridge";
359+
innerName = "DesktopWindowXamlSource";
360+
}
361+
else
362+
{
363+
outerClass = "NativeHWNDHost";
364+
innerClass = "DirectUIHWND";
365+
}
366+
367+
while ((hWndHost = FindWindowEx(IntPtr.Zero, hWndHost, outerClass, outerName)) != IntPtr.Zero)
345368
{
346-
IntPtr hWndDUI;
347-
if ((hWndDUI = FindWindowEx(hWndHost, IntPtr.Zero, "DirectUIHWND", "")) != IntPtr.Zero)
369+
if ((hWndDUI = FindWindowEx(hWndHost, IntPtr.Zero, innerClass, innerName)) != IntPtr.Zero)
348370
{
349371
GetWindowThreadProcessId(hWndHost, out int pid);
350372
if (Process.GetProcessById(pid).ProcessName.ToLower() == "explorer")

ModernFlyouts.Core/Media/Control/GSMTCMediaSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Toolkit.Mvvm.Input;
1+
using CommunityToolkit.Mvvm.Input;
22
using ModernFlyouts.Core.AppInformation;
33
using ModernFlyouts.Core.Helpers;
44
using System;

ModernFlyouts.Core/Media/Control/MediaSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Microsoft.Toolkit.Mvvm.ComponentModel;
2-
using Microsoft.Toolkit.Mvvm.Input;
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using CommunityToolkit.Mvvm.Input;
33
using System;
44
using System.Windows;
55
using System.Windows.Input;

ModernFlyouts.Core/Media/Control/MediaSessionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Toolkit.Mvvm.ComponentModel;
1+
using CommunityToolkit.Mvvm.ComponentModel;
22
using System;
33
using System.Collections.ObjectModel;
44

ModernFlyouts.Core/Media/Control/NowPlayingMediaSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.Toolkit.Mvvm.Input;
1+
using CommunityToolkit.Mvvm.Input;
22
using ModernFlyouts.Core.AppInformation;
33
using ModernFlyouts.Core.Helpers;
44
using ModernFlyouts.Core.Threading;

ModernFlyouts.Core/ModernFlyouts.Core.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.0" />
12+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
13+
<PackageReference Include="CommunityToolkit.Mvvm" Version="7.1.0" />
1314
<PackageReference Include="NAudio" Version="2.0.1" />
1415
<PackageReference Include="NPSMLib" Version="0.9.14" />
1516
<PackageReference Include="System.Drawing.Common" Version="6.0.0-rc.2.21480.5" />

ModernFlyouts.Package/ModernFlyouts.Package.wapproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
4444
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
4545
<GenerateTestArtifacts>True</GenerateTestArtifacts>
46-
<AppxBundlePlatforms>x86|x64|arm64</AppxBundlePlatforms>
46+
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
4747
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
4848
<AppInstallerUri>https://ModernFlyouts-community.github.io/package.github.io/ModernFlyouts.Package/ModernFlyouts.Package.appinstaller</AppInstallerUri>
4949
<EntryPointProjectUniqueName>..\ModernFlyouts\ModernFlyouts.csproj</EntryPointProjectUniqueName>
@@ -110,7 +110,9 @@
110110
<Content Include="Images\Wide310x150Logo.scale-150.png" />
111111
<Content Include="Images\Wide310x150Logo.scale-200.png" />
112112
<Content Include="Images\Wide310x150Logo.scale-400.png" />
113-
<PRIResource Include="Strings\en-us\Resources.resw" />
113+
<PRIResource Include="Strings\en-us\Resources.resw">
114+
<SubType>Designer</SubType>
115+
</PRIResource>
114116
<None Include="ModernFlyouts.Package_TemporaryKey.pfx" />
115117
<Content Include="Package.appinstaller" />
116118
<Content Include="priconfig.default.xml" />
@@ -122,7 +124,6 @@
122124
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
123125
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
124126
</ProjectReference>
125-
<ProjectReference Include="..\ModernFlyoutsBridge\ModernFlyoutsBridge.vcxproj" />
126127
</ItemGroup>
127128
<Target Name="FlattenPackage" BeforeTargets="_ConvertItems">
128129
<ItemGroup>

0 commit comments

Comments
 (0)