After a couple hours of Googling I haven't been able to find any comments on this issue. We have a WindowStyle=None
window with transparent background and allows transparency and does not show in taskbar, all pretty normal. Here's the XAML so you can test for yourself:
<Window x:Class="AltTabTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="TestWindow" Title="TestWindow"
WindowStyle="None" AllowsTransparency="True" ResizeMode="NoResize"
Background="Transparent" ShowInTaskbar="False"
Width="816" Height="820">
<Grid>
<Border BorderThickness="0" Background="LightBlue" CornerRadius="15" />
</Grid>
Now what's bizarre is once you compile and run this window, follow these steps:
- Click on Show Desktop to hide all apps
- Alt+Tab back to the WPF Test App
- Click outside of the Light Blue border area (to the desktop workspace)
- Observe WPF Test App magically disappear
- Optionally Alt+Tab to any other running app and observe WPF Test App magically re-appear
So my question is: what the heck is going on here?! Is this expected behavior? If so, is there any way around it?
It feels like the WPF app is not truly getting focus after the Alt+Tab is resolved. Please note this is being tested in Windows 7 and I have not had the capability to test this in Vista or XP. I'd like a way to force the app to truly get focus, but if that's not possible then I'm wondering if there's a way to trap and ignore Alt+Tab actions. The app this is intended to fix is a lockdown mode app so users should never be able to truly get away from it running on the desktop. Any advice, examples, insight or point in the right direction would be appreciated, thanks! =)