我有一个 UWP 应用程序在分配的访问权限(Kiosk 模式)下运行。当 PC 启动且用户登录时,应用程序以分配的访问权限启动,用户可以使用 TAB 按钮在应用程序内导航。
但是,锁定PC(CTRL+ALT+DEL),再次登录后,焦点就丢失了。您必须使用鼠标并单击应用程序的某处才能将焦点恢复。
我能够确定在使用 CTRL+ALT+DEL 锁定 PC 并重新登录后,具有焦点的应用程序是“Assigned Access Lock app”。
我已经尝试了一些解决方法,使用 user32.dll 中的 SetForegroundWindow 将焦点重新设置,但没有成功。
有人知道这里发生了什么吗?这是错误还是预期的行为?
电脑设置:
Windows 10 企业版 22H2
操作系统版本:19045.2728
它似乎与应用程序无关,因为我尝试使用简单的UWP应用程序。这是 MainPage.xaml:
<Page x:Class="TestUwp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestUwp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<TextBox HorizontalAlignment="Left" Margin="419,385,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Height="115" Width="385"/>
<TextBox HorizontalAlignment="Left" Margin="419,568,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Height="120" Width="294"/>
</Grid>
</Page>
我试过下面,但结果是一样的: