> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IXtfRunningProcessCallback::OnFoundProcess

> IXtfRunningProcessCallback::OnFoundProcess

# IXtfRunningProcessCallback::OnFoundProcess

在发现正在运行的进程时调用。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
HRESULT OnFoundProcess(
         LPCXTFPROCESSINFO pProcessData
)  
```

<a id="parametersSection" />

### 参数

*pProcessData*\
类型：LPCXTFPROCESSINFO

指向 [XTFPROCESSINFO](/reference/tools/xtf/xtfconsolecontrol/structs/xtfprocessinfo) 结构的指针，其中包含有关正在运行的进程的信息。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功，则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此回调函数由 [IXtfConsoleControlClient::GetRunningProcesses](/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getrunningprocesses) 针对开发主机上发现的每个正在运行的进程调用。此函数接收一个指向 [XTFPROCESSINFO](/reference/tools/xtf/xtfconsolecontrol/structs/xtfprocessinfo) 结构的指针，该结构包含正在运行的进程的进程 ID 和进程映像文件名。有关使用 XBOX Tools Framework (XTF) 列出正在运行的进程的详细信息，请参阅 [进程列表 (xbtlist.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbtlist)。

<Note>[XTFPROCESSINFO](/reference/tools/xtf/xtfconsolecontrol/structs/xtfprocessinfo) 结构的内存归 XBOX Tools Framework (XTF) API 所有，并在每次调用此回调函数后失效。如果你稍后需要使用这些信息，则必须复制该结构中的信息。</Note>

<a id="requirementsSection" />

## 要求

**头文件：** xtfconsolecontrol.h

**库：** xtfconsolecontrol.lib

**支持的平台：** Windows（适用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[IXtfRunningProcessCallback](/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/ixtfrunningprocesscallback)\
[XtfConsoleControl](/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members)\
[XBOX Tools Framework 原生 API 参考](/reference/tools/xtf/atoc-xtf-native)


## Related topics

- [IXtfConsoleControlClient::GetRunningProcesses](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConsoleControlClient/methods/ixtfconsolecontrolclient_getrunningprocesses.md)
- [XTFPROCESSINFO](/zh-CN/reference/tools/xtf/xtfconsolecontrol/structs/xtfprocessinfo.md)
- [IXtfRunningProcessCallback](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfRunningProcessCallback/ixtfrunningprocesscallback.md)
- [XtfGetTitleProcessMemoryReports](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfgettitleprocessmemoryreports-xtfapi-xbox-windows-m.md)
- [IXtfConfigSettingsCallback::OnFoundSetting](/zh-CN/reference/tools/xtf/xtfconsolecontrol/interfaces/IXtfConfigSettingsCallback/methods/ixtfconfigsettingscallback_onfoundsetting.md)
