> ## 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.

# XtfCaptureScreenshot

> XtfCaptureScreenshot

# XtfCaptureScreenshot

Captures the current screen display of the specified development console as a bitmap.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT XtfCaptureScreenshot(
         LPCWSTR address,
         HBITMAP* phBitmap
)  
```

<a id="parametersSection" />

### Parameters

*address*   \
Type: LPCWSTR

A pointer to the tools IP address or hostname of the development console.

*phBitmap*   \
Type: HBITMAP\*

A pointer to the HBITMAP of the bitmap for the captured screen display, if successful. When you have finished using this bitmap, call `DeleteObject` to free the resources associated with the HBITMAP.

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, it returns an HRESULT error code.

<a id="remarksSection" />

## Remarks

This function captures a bitmap of what is currently displayed on the screen of the specified development console. The bitmap includes anything that is currently displayed on the console output, including exclusive apps, shared apps, snapped apps, system UI such as Home or notification pop-ups, and so on. The bitmap uses the currently selected display resolution for the console.

Using **XtfCaptureScreenshot** takes momentary control of the video output stream. This causes a momentary framerate glitch on the display, and can cause a black-screen segment in video recorded by GameDVR at the time of the capture.

Your code should follow recommended programming practice and use the embedded information in the bitmap returned in `phBitmap` to determine the resolution of the resulting bitmap. The expected resolution of the resulting bitmap matches the current screen resolution of the development console.

For more information about capturing a screenshot, see [Screen-capture tool (xbcapture.exe) (NDA topic)](/tools/tools-console/commandlinetools/xbcapture).

<a id="requirementsSection" />

## Requirements

**Header:** xtfconsolecontrol.h

**Library:** xtfconsolecontrol.lib

**Supported platforms:** Windows (for XBOX console tools)

<a id="seealsoSection" />

## See also

[XtfConsoleControl](/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members)\
[XBOX Tools Framework native API reference](/reference/tools/xtf/atoc-xtf-native)


## Related topics

- [XtfCaptureRecordedGameClip](/reference/tools/xtf/xtfapi/functions/xtfcapturegameclip-xbox-microsoft-m.md)
- [XAppCaptureScreenshotStream](/reference/system/xappcapture/structs/xappcapturescreenshotstream.md)
- [XAppCaptureScreenshotFile](/reference/system/xappcapture/structs/xappcapturescreenshotfile.md)
- [XAppCaptureTakeScreenshot](/reference/system/xappcapture/functions/xappcapturetakescreenshot.md)
- [XAppCaptureOpenScreenshotStream](/reference/system/xappcapture/functions/xappcaptureopenscreenshotstream.md)
