Click here to Skip to main content
15,885,910 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to prevent some apps and processes from opening. When I want to prevent a desktop app or a process from opening, I am hooking the CreateProcess function and opening only if the particular app/proc is allowed to run.

For instance, if the user tries to open notepad, my program would first check if notepad is allowed to run in the system, and only if it is allowed, notepad is opened. This is working perfectly for normal applications and procs.

But this method doesn't seem to work with UWP applications like Groove Music for example.

When I use this method, the method to check if the application is allowed to run has to be executed only after the application opens.

I want my program to do the same for UWP apps also. If the User tries to open Groove music, I want my program to check if it is allowed to run, and only if is is, the application should open.

Is there any way to prevent a specific UWP application from opening in the first place if it is not whitelisted, as in, is there any method to hook the ActivateApplication method to check and then open the application?

What I have tried:

I tried opening it using CreateProcess. But UWP apps don't seem to open using that
Posted
Updated 13-Jan-19 20:04pm
v2
Comments
Richard MacCutchan 14-Jan-19 6:49am    
A better idea would be to use the security policy system to block certain applications.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900