none
Prevent UWP apps from opening RRS feed

  • Question

  • 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?

    Monday, January 14, 2019 6:40 AM

Answers

  • Hi,

    Thank you for posting here.

    >>Prevent UWP apps from opening

    I think that there is no method to hook the ActivateApplication method to check and then open the application.

    When available system resources allow, the startup performance of UWP apps on desktop device family devices is improved by proactively launching the user’s most frequently used apps in the background. A prelaunched app is put into the suspended state shortly after it is launched. Then, when the user invokes the app, the app is resumed by bringing it from the suspended state to the running state.
    Whether an app is prelaunched depends on system resources. If the system is experiencing resource pressure, apps are not prelaunched.

    Best wishes,

    Jeanine Zhang

    Tuesday, January 15, 2019 5:07 AM
    Moderator

All replies

  • Hi,

    Thank you for posting here.

    >>Prevent UWP apps from opening

    I think that there is no method to hook the ActivateApplication method to check and then open the application.

    When available system resources allow, the startup performance of UWP apps on desktop device family devices is improved by proactively launching the user’s most frequently used apps in the background. A prelaunched app is put into the suspended state shortly after it is launched. Then, when the user invokes the app, the app is resumed by bringing it from the suspended state to the running state.
    Whether an app is prelaunched depends on system resources. If the system is experiencing resource pressure, apps are not prelaunched.

    Best wishes,

    Jeanine Zhang

    Tuesday, January 15, 2019 5:07 AM
    Moderator
  • Thanks. This was helpful :D

    Wednesday, January 16, 2019 6:46 AM
  • Hi,

    How about the issue ,is there anything to update?

    I would appreciate it if you could click "Mark as Answer" on the post that helps you.

    Best Regards,

    Jeanine Zhang

    Thursday, January 17, 2019 1:41 AM
    Moderator