microsoft / microsoft/microsoft-ui-xaml
When the WinUI3 window of Windows App SDK 1.6 is launched, it will cause any window with the TOPMOST style of any other process to lose the TOPMOST effect
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
When the `WinUI3 desktop` window is launched, **any window** with the `TOPMOST` style of **any other process** will lose the `TOPMOST` effect, but the `TOPMOST` style does not disappear.
### Steps to reproduce the bug
1. Use Visual Studio 2022 to create a WinUI3 project, the development language is C++.

2. Upgrade the WindowsAppSDK version to 1.6 via Nuget.

3. When upgrading Windows App SDK, an error is generated, prompting that Visual Studio needs to be restarted, but the upgrade is successful.

4. After restarting Visual Studio, compile and run the project, the bug reappears.
[HelloWinUI3.zip](https://github.com/user-attachments/files/17349103/HelloWinUI3.zip)
5. For example, if we start procexp and turn on `Options`-`Always On Top`, we can check the window style through spyxx. As shown in the following picture, we can see that the Explorer window has the focus, but the procexp window is TopMost, so the Explorer window can only be behind now.

6. Then we start the C++ WinUI3 Deskop window and the bug reappears. As shown in the following picture, click the Explorer window to give it focus, and then the procexp window and the spyxx property window are displayed at the back. If you click them again, the TOPMOST state will be restored.

### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
WinUI 3 - Windows App SDK 1.6.0: 1.6.240829007
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
### Windows version
Windows 11 (22H2): Build 22621
Windows 11 (23H2): Build 22635
Windows 11 (24H2): Build 26100
### IDE
Visual Studio 2022
### Additional context
Downgrading to version 1.5 and clearing all dynamically generated files can be recovered.
I'm not sure if this is a WinUI3 bug or a WindowsAppSDK bug, so I raised issues in both projects.
See also: https://github.com/microsoft/WindowsAppSDK/issues/4801
Contributor guide
Assessment
This issue has not been assessed yet.