Assigned access application exits when Ctrl + Alt + Delete is pressed.

拟墨画扇 提交于 2019-12-08 03:30:50

问题


I have set up assigned access on windows 10. The breakout key is currently set to ctrl + alt + delete (the default). However it seems as though when this breakout key is used that the application exits? Is it possible to keep the application running i.e. essentially switch user instead of log off?


回答1:


You can set larger time-out period in registry

To sign out of an assigned access account, press Ctrl + Alt + Del, and then sign in using another account. When you press Ctrl + Alt + Del to sign out of assigned access, the kiosk app will exit automatically. If you sign in again as the assigned access account or wait for the login screen timeout, the kiosk app will be re-launched.

If you press Ctrl + Alt + Del and do not sign in to another account, after a set time, assigned access will resume. The default time is 30 seconds, but you can change that in the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI****

To change the default time for assigned access to resume, add IdleTimeOut (DWORD) and enter the value data as milliseconds in hexadecimal.

taken from Set up a kiosk on Windows 10

You can save application state in suspending event and restore this state later in resuming event, like it's recommended. That's not too difficult.

In declarations add:

    ApplicationDataContainer currentC = ApplicationData.Current.LocalSettings;

And somewhere in class constructor after InitializeComponent();

    App.Current.Suspending += new SuspendingEventHandler(App_Suspending);
    App.Current.Resuming += new EventHandler<Object>(App_Resuming);

Now you should realize events:

 async void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
    {
 var waitState = e.SuspendingOperation.GetDeferral();
   // save all information from app in setting or in file
   currentC.Values["somesetting"] = someVariable;
 waitState.Complete();
    }

  private void App_Resuming(object sender, object e)
    {
        someVariable = (int)currentC.Values["somesetting"];
    }

You can find in web more information about App lifecycle



来源:https://stackoverflow.com/questions/36939547/assigned-access-application-exits-when-ctrl-alt-delete-is-pressed

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