Skip to content

Commit 2a31fee

Browse files
authored
Avoid "XamlExplorerHostIslandWindow" issues & Support for Insider Build (#1210)
* Updated the toolkit Microsoft deprecated the old toolkit and released the same thing under a new name. * Update ModernFlyouts.Package.wapproj * Update README.md * Extra check for volume OSD - Checks the band the window is on to make sure that it is the volume bar * Fixes Windows 25000 Builds Allows flyout window to be painted without using a plane (or whatever it's called) so it can run on Windows Canary Builds. * Revert README.md * Revert name
1 parent 60626f8 commit 2a31fee

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

ModernFlyouts.Core/Interop/BandWindow.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ public void CreateWindow()
351351
{
352352
WindowStyle = (int)(WindowStyles.WS_VISIBLE | WindowStyles.WS_CHILD),
353353
ParentWindow = hWnd,
354-
UsesPerPixelTransparency = true
354+
UsesPerPixelTransparency = true,
355+
ExtendedWindowStyle = (int)(ExtendedWindowStyles.WS_EX_NOREDIRECTIONBITMAP)
355356
};
356357

357358
hwndSource = new(param)

ModernFlyouts.Core/Interop/NativeFlyoutHandler.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,15 @@ private bool GetAllInfos()
371371
GetWindowThreadProcessId(hWndHost, out int pid);
372372
if (Process.GetProcessById(pid).ProcessName.ToLower() == "explorer")
373373
{
374-
HWndHost = hWndHost;
375-
HWndDUI = hWndDUI;
376-
ShellProcessId = (uint)pid;
377-
return true;
374+
UIntPtr pdwBand = UIntPtr.Zero;
375+
GetWindowBand(hWndHost, out pdwBand);
376+
if (pdwBand == (UIntPtr)ZBandID.AboveLockUX)
377+
{
378+
HWndHost = hWndHost;
379+
HWndDUI = hWndDUI;
380+
ShellProcessId = (uint)pid;
381+
return true;
382+
}
378383
}
379384
}
380385
}

ModernFlyouts.Core/Interop/NativeMethods.cs

+3
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,9 @@ internal static IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLon
778778
[DllImport("user32.dll", SetLastError = true)]
779779
internal static extern uint GetWindowThreadProcessId(IntPtr hWnd, out int processId);
780780

781+
[DllImport("user32.dll", SetLastError = true)]
782+
internal static extern bool GetWindowBand(IntPtr hWnd, out UIntPtr pdwBand);
783+
781784
[DllImport("user32.dll", SetLastError = true)]
782785
internal static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
783786

0 commit comments

Comments
 (0)