Changes:
1. Runs as a service, allowing it to start earlier.
2. Supports showing the dialog to a logged on user while still blocking inputs.
3. Unblock the keyboard/mouse when needed.
So showing a WPF in user context while blocking the keyboard + mouse, no problem at all... Yeah right.
Don't get me wrong, that isn't a problem until a user presses Ctrl+Alt+Del triggering gina/winlogon which always has the upper hand.
So how about reapplying the block afterwards?
Turned out that BlockInput (User32.dll) doesn't work just by running it in the system context.
It must be run in the session that you want to apply the input block to and needs admin privileges.
Long story short (never done this before), made a named pipe and after hitting my head against the wall a couple of times, I got it working.
The WPF is running in user context and it can still trigger a function which is reapplying the inputblock without exposing anything running as system interactively in the user session.
I'm a bit picky, but to those who might be even pickier, set DisableTaskMgr=1 if it's really important that the user shouldn't be able to kill the script.(https://www.thewindowsclub.com/change-ctrl-alt-delete-options-windows).
Works in HKLM too.
Due to the fact that some parts are running in user context, the package needs to be downloaded somewhere where a user can read it.
The service won't ruin the computer if left behind but use "SC delete %ServiceName%" in the end of the TS and in the group which is handling errors.
To bypass the input block, please take a look at my previous post.
You can find the edited scripts here: https://github.com/MattiasC85/UserInfoUI/tree/master/InfoUI%20Service
Comments