Prevent the user from switching to other windows

I want to allow my user to work with several predefined lists of applications for a certain time. I use the Windows C # service, which will run in the background and check the active window for a certain period of time to make sure that the active application is in the list of allowed applications.

I did my homework, and it seems to me that I need to capture the "window switch" event via SetWinEventHook() , and then call SwitchToThisWindow() or SetActiveWindow() to return in case a new window is not allowed.

But that does not work. I can still switch to other windows.

What am I doing wrong, or even if I use the right approach?

+4
source share
1 answer

Is this creating a custom application machine and / or web kiosk system? Perhaps you should take a look at Windows XP Embedded, where you can remove the explorer and the ability to run any application other than what you want. It is specifically designed for the scenario that you are describing.

+1
source

Source: https://habr.com/ru/post/1394130/


All Articles