Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid "XamlExplorerHostIslandWindow" issues & Support for Insider Build #1210

Merged
merged 8 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ModernFlyouts.Core/Interop/BandWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ public void CreateWindow()
{
WindowStyle = (int)(WindowStyles.WS_VISIBLE | WindowStyles.WS_CHILD),
ParentWindow = hWnd,
UsesPerPixelTransparency = true
UsesPerPixelTransparency = true,
ExtendedWindowStyle = (int)(ExtendedWindowStyles.WS_EX_NOREDIRECTIONBITMAP)
};

hwndSource = new(param)
Expand Down
13 changes: 9 additions & 4 deletions ModernFlyouts.Core/Interop/NativeFlyoutHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,15 @@ private bool GetAllInfos()
GetWindowThreadProcessId(hWndHost, out int pid);
if (Process.GetProcessById(pid).ProcessName.ToLower() == "explorer")
{
HWndHost = hWndHost;
HWndDUI = hWndDUI;
ShellProcessId = (uint)pid;
return true;
UIntPtr pdwBand = UIntPtr.Zero;
GetWindowBand(hWndHost, out pdwBand);
if (pdwBand == (UIntPtr)ZBandID.AboveLockUX)
{
HWndHost = hWndHost;
HWndDUI = hWndDUI;
ShellProcessId = (uint)pid;
return true;
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions ModernFlyouts.Core/Interop/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,9 @@ internal static IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLon
[DllImport("user32.dll", SetLastError = true)]
internal static extern uint GetWindowThreadProcessId(IntPtr hWnd, out int processId);

[DllImport("user32.dll", SetLastError = true)]
internal static extern bool GetWindowBand(IntPtr hWnd, out UIntPtr pdwBand);

[DllImport("user32.dll", SetLastError = true)]
internal static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);

Expand Down