I'm making an application that needs to see the user's application history because it wants to keep track of how much time the user is spending on each application as well as historically how much time they have spent on it, but I am having a hard time finding documentation online of how to do this.
I saw that there is an Activity History inside the windows user's privacy & security tab in the settings and was wondering how you could possibly use those statistics in code.
I also saw that it might be possible using the Windows.System.Diagnostics namespace to gather information about app usage but every time I try running a program using that it says permission denied even if I run it in administrator.
Is there any way to view a user's past application usage stats in windows and C#?