Windows 8.1为桌面应用程序分配了访问权限 [英] windows 8.1 assigned access for Desktop App
问题描述
我有一个用WPF编写的桌面应用程序(最初是Windows 7),希望在Microsoft Surface Pro 2上以Kiosk(分配访问模式)运行。分配的访问功能看上去很完美,但不支持非商店应用。
I have a Desktop Application written in WPF (originally for Windows 7) that I would like to run in Kiosk (Assign Access mode) on a Microsoft Surface Pro 2. The assigned access feature looked perfect, but it doesn't support non-store apps.
我只需要一种方法来防止用户切换到另一个应用或访问操作系统等。
I just need a way to prevent the user from switching to another app or getting access to the OS etc.
可能吗?
推荐答案
-
使应用程序全屏显示,如图所示此处:全屏wpf
在主窗口构造函数中,订阅Deactivate事件或重写OnDeactivate方法:
In your main window constructor subscribe on Deactivate event or override OnDeactivate method:
Deactivated += delegate(object sender, EventArgs e) {
Activate();
};
您还希望通过处理Closing事件来防止Alt + F4窗口关闭
You would also want to prevent the window from Alt+F4 closing by handling the Closing event on such a way:
Closing += delegate(object sender, CancelEventArgs e)
{
if(!Environment.HasShutdownStarted)
e.Cancel = true;
};
完成后,该应用程序仅可关闭由任务管理器退出并关闭。
After all done, the application is closable only by task manager, sign out and shutdown.
这篇关于Windows 8.1为桌面应用程序分配了访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!