Так что означает: нет очевидного окна: без титула, нет элемента Alt+вкладка
Я смог достичь этого с помощью ws_ex_transprent . В основном как < /p>
Код: Выделить всё
private const int WS_EX_LAYERED = 0x80000; // needed to make it clickthrough
private const int WS_EX_TOOLWINDOW = 0x80; // toolwindow means no alt+tab entry
private const int WS_EX_TRANSPARENT = 0x20; // disables hit testing -> bad
private void OnWindowActivated(object? sender, EventArgs e)
{
if (sender is not Window window) return;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
IntPtr? platformHandle = window.TryGetPlatformHandle()?.Handle;
if (platformHandle.HasValue && platformHandle.Value != IntPtr.Zero)
{
IntPtr hWnd = platformHandle.Value;
// Get current extended style
int extendedStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
// Add WS_EX_LAYERED, WS_EX_TRANSPARENT, and WS_EX_TOOLWINDOW
_ = SetWindowLong(hWnd, GWL_EXSTYLE, extendedStyle | WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW);
}
}
}
< /code>
WS_EX_TRANSPARENT
, но я хочу сделать, это просто отключить тестирование удара на заднем плане. А затем решайте для каждого элемента, нужно ли он быть хиттором или нет. Но Аволония не позволит мне это сделать. По крайней мере, я не смог понять.
< /code>
When I keep the window like that and don't extend the window styles it does everything I want EXCEPT the hit tests... it just won't let me click through the window into the background.
Подробнее здесь: https://stackoverflow.com/questions/797 ... background