@David Lowndes , @Xiaopo Yang - MSFT
There is no difference in behavior in Windows 11 22H2 22621.1778, nor in the latest Windows 10 update. Tested with Visual Studio 2022 17.6.2 with the latest Windows SDK. As David mentioned, it is visible in system Win32 windows, not in windows with custom title bars created by higher-level frameworks.
It is definitely a bug. It is unacceptable that calling the api function to read system information would leave such side effects on the system.
May you pass this problem on to the appropriate MSFT team whose interest is to make the system work properly?