Skip to content

Commit

Permalink
Update TransparentTintBackdrop.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 authored Jan 14, 2025
1 parent 3a4269a commit fb55140
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/WinUIEx/TransparentTintBackdrop.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.UI.Composition;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Hosting;
using Microsoft.UI;
using System;
using System.Runtime.InteropServices;
using Windows.Win32;
Expand Down Expand Up @@ -60,9 +61,7 @@ protected override Windows.UI.Composition.CompositionBrush CreateBrush(Windows.U
/// <inheritdoc />
protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot)
{
var inspectable = connectedTarget.As<IInspectable>();
var xamlSource = DesktopWindowXamlSource.FromAbi(inspectable.ThisPtr);
var hWnd = xamlSource.SiteBridge.SiteView.EnvironmentView.AppWindowId.Value;
ulong hWnd = (ulong)Win32Interop.GetWindowFromWindowId(xamlRoot.ContentIslandEnvironment.AppWindowId);

monitor = new WindowMessageMonitor((IntPtr)hWnd);
monitor.WindowMessageReceived += Monitor_WindowMessageReceived;
Expand Down

0 comments on commit fb55140

Please sign in to comment.