windows 8.1 assigned access for Desktop App

心已入冬 提交于 2019-12-10 21:42:33

问题


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.

Possible?


回答1:


  1. Make your application fullscreen as shown here: full screen wpf

  2. In your main window constructor subscribe on Deactivate event or override OnDeactivate method:

        Deactivated += delegate(object sender, EventArgs e) {
            Activate();
        };
    
  3. 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.



来源:https://stackoverflow.com/questions/20108613/windows-8-1-assigned-access-for-desktop-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!