Exemplo n.º 1
0
        private static string GetUwpId(Window application)
        {
            var process = ProcessDiagnosticInfo.TryGetForProcessId((uint)application.process.Id);

            foreach (var appDiagnosticInfo in process.GetAppDiagnosticInfos())
            {
                return(appDiagnosticInfo.AppInfo.AppUserModelId);
            }

            return("None");
        }
Exemplo n.º 2
0
        private static ImageSource GetUwpIcon(Window application)
        {
            var uwpProcess = ProcessDiagnosticInfo.TryGetForProcessId((uint)application.process.Id);

            var appInfos     = uwpProcess.GetAppDiagnosticInfos();
            var appInfoCount = appInfos.Count;
            var appInfo      = appInfos[0].AppInfo;
            var name         = appInfo.AppUserModelId;


            var shellItem =
                InstalledApplications.First(item => ApplicationUtils.GetAppModelUserId(item) == appInfo.AppUserModelId);
            var bitmap = ApplicationUtils.GetIcon(shellItem);


            return(bitmap);
        }
Exemplo n.º 3
0
        private static bool NotSuspended(Window window)
        {
            var diagnosticInfo = ProcessDiagnosticInfo.TryGetForProcessId((uint)window.process.Id);

            if (!diagnosticInfo.IsPackaged)
            {
                return(true);
            }

            var appDiagnosticInfos = diagnosticInfo.GetAppDiagnosticInfos();
            var anySuspended       = appDiagnosticInfos.Any(info =>
                                                            info.GetResourceGroups().Any(resourceInfo =>
                                                                                         resourceInfo.GetStateReport().ExecutionState == AppResourceGroupExecutionState.Suspended
                                                                                         )
                                                            );

            return(!anySuspended);
        }