Compartilhar via


CoreWebView2Environment.GetProcessExtendedInfosAsync Method

Definition

Returns a snapshot collection of CoreWebView2ProcessInfo corresponding to all currently running processes associated with this CoreWebView2Environment excludes crashpad process. This provides the same list of CoreWebView2ProcessInfo as what's provided in GetProcessInfos(), but additionally provides a list of associated CoreWebView2FrameInfo which are actively running (showing or hiding UI elements) in the renderer process. See AssociatedFrameInfos for more information.

public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.Web.WebView2.Core.CoreWebView2ProcessExtendedInfo>> GetProcessExtendedInfosAsync ();
member this.GetProcessExtendedInfosAsync : unit -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.Web.WebView2.Core.CoreWebView2ProcessExtendedInfo>>
Public Function GetProcessExtendedInfosAsync () As Task(Of IReadOnlyList(Of CoreWebView2ProcessExtendedInfo))

Returns

Examples

IReadOnlyList<CoreWebView2ProcessExtendedInfo> processList = await _iWebView2.CoreWebView2.Environment.GetProcessExtendedInfosAsync();
int processCount = processList.Count;
string rendererProcessInfos = "";
string otherProcessInfos = "";
int rendererProcessCount = 0;
for (int i = 0; i < processCount; ++i)
{
    CoreWebView2ProcessInfo processInfo = processList[i].ProcessInfo;
    CoreWebView2ProcessKind kind = processInfo.Kind;
    int processId = processInfo.ProcessId;
    if (kind == CoreWebView2ProcessKind.Renderer)
    {
        int frameInfoCount = 0;
        string frameInfos = "";
        IReadOnlyList<CoreWebView2FrameInfo> frameInfoList = processList[i].AssociatedFrameInfos;
        foreach (CoreWebView2FrameInfo frameInfo in frameInfoList)
        {
            frameInfoCount++;
            frameInfos += AppendFrameInfo(frameInfo);
        }
        string rendererProcessInfo = $"{frameInfoCount} frame info(s) found in renderer process ID: {processId}\n {frameInfos}";
        rendererProcessInfos += $"{rendererProcessInfo} \n";
        rendererProcessCount++;
    }
    else
    {
        otherProcessInfos += $"Process ID: {processId} | Process Kind: {kind}\n";
    }
}

Applies to