Overview
WindowCast streams the contents of a desktop window into Unreal Engine 4.27 and 5.8 as a regular Texture2D. Capture runs on a background thread through the Windows Graphics Capture API, so the window keeps updating while it is partly covered by other windows. You choose the window by its title, set a frame rate, call Start and receive the texture through the Change Texture event.
- Capture of any top-level desktop window into a BGRA8 texture.
- Five title matching modes, from exact match to regular expressions (case-insensitive).
- Capture rate from 1 to 120 frames per second.
- A new texture is created and broadcast whenever the captured window changes size.
- Actor and UMG widget base classes, plus a capture object for custom setups.
- Sample plane actor and UMG widget with materials.
Requirements
| Requirement | Details |
| Unreal Engine | 4.27 and 5.8 (verified clean on both) |
| Modules | WindowCast (Runtime) |
| Dependencies | None (engine modules only; no other plugins are enabled) |
| Language | Blueprints and C++ |
| Platforms | Win64 only (the module is restricted to Win64 in the plugin descriptor; verified by Alpha XP). Capture requires Windows 10 version 1903 or newer; building the plugin requires a Windows 10 SDK 10.0.18362 or newer. |
Installation
- Install WindowCast from Fab into your engine, or copy the
WindowCast folder into your project's Plugins folder.
- For a C++ project, regenerate project files and build the editor target.
- Open the project, enable WindowCast in Edit > Plugins and restart the editor.
- C++ only: the module exists only on Win64, so add it for that platform:
if (Target.Platform == UnrealTargetPlatform.Win64) { PrivateDependencyModuleNames.Add("WindowCast"); } and wrap your calls in #if PLATFORM_WINDOWS.
Verifying the installEnable Show Plugin Content in the Content Browser settings: the WindowCast content folder contains PlaneActor/WindowCastPlane and Widget/WindowCastUMG, and AWindowCastActor can be chosen as a Blueprint parent class.
Quick start
On a mesh in the level
- Open the window you want to show (for example a text editor) and note its title.
- Drag
PlaneActor/WindowCastPlane into the level.
- In the Details panel, expand Properties, set Capture Target Title (for example
Notepad) and choose Title Matching Window Search = Partial Match.
- Press Play. The sample calls Start on Begin Play and writes every texture from Change Texture into the
Texture parameter of its material.
In a UMG widget
- Create
Widget/WindowCastUMG (or your own widget whose parent class is UWindowCastWidget) with Create Widget and add it to the viewport.
- Set its Properties; the widget graph calls Start and applies the texture from Change Texture to its image.
C++
// Build.cs: if (Target.Platform == UnrealTargetPlatform.Win64) { PrivateDependencyModuleNames.Add("WindowCast"); }
// MyScreen.h: UPROPERTY() UWindowCastMachine* Capture = nullptr;
// UFUNCTION() void HandleNewTexture(UTexture2D* NewTexture);
#include "WindowCastMachine.h"
void AMyScreen::BeginPlay()
{
Super::BeginPlay();
Capture = NewObject<UWindowCastMachine>(this);
Capture->Properties.CaptureTargetTitle = TEXT("Notepad");
Capture->Properties.TitleMatchingWindowSearch = EWindowCastTitleMatch::PartialMatch;
Capture->Properties.FrameRate = 30;
Capture->ChangeTexture.AddDynamic(this, &AMyScreen::HandleNewTexture);
Capture->Start();
}
void AMyScreen::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
if (Capture)
{
Capture->Dispose();
Capture = nullptr;
}
Super::EndPlay(EndPlayReason);
}
Actor & widget
Both classes own a capture object while they run. Start is a protected node: call it from the graph of a Blueprint that derives from the class (as the samples do).
| Node | Type | Description |
| AWindowCastActor | Class | Actor base class (Blueprintable). Disposes the capture on End Play. |
| UWindowCastWidget | Class | User Widget base class (Blueprintable). Disposes the capture when its Slate resources are released. |
| Start | Callable | Starts (or restarts) capturing the window described by Properties. Returns the current texture, which is empty until the first frame arrives. |
| Change Texture | Event | Event dispatcher with NewTexture; broadcast when a capture texture is created (first frame and every window resize). |
| Properties | Property | FWindowCastProperties used by the next Start. |
| Texture Target | Property | Read-only texture reference on the class; use the texture passed to Change Texture for display. |
Capture object
| Node | Type | Description |
| UWindowCastMachine | Class | Object that finds the window, runs the capture session and updates the texture. Create it with Construct Object from Class (Blueprint) or NewObject (C++) and keep a reference to it. |
| Start | Callable | Searches the top-level windows for the title in Properties and starts capturing it. Logs a warning in LogWindowCast when the title is empty or no window matches. |
| Dispose | Callable | Stops the capture and releases the session. Call it when you no longer need the capture. |
| Change Texture | Event | Broadcast with the new texture when it is created or recreated. |
| Texture Target | Property | The current capture texture (BGRA8, sized like the window). |
| Properties | Property | Capture settings, see below. |
Capture properties
| Node | Type | Description |
| FWindowCastProperties | Class | Structure with the three settings below. |
| Capture Target Title | Property | Text to look for in window titles. Default WindowCast. |
| Title Matching Window Search | Property | How the title is compared (EWindowCastTitleMatch). Default Forward Match. |
| Frame Rate | Property | Texture updates per second, 1 to 120. Default 30. |
| Perfect Match | Enum value | Title equals the text. |
| Forward Match | Enum value | Title starts with the text. |
| Partial Match | Enum value | Title contains the text. |
| Backward Match | Enum value | Title ends with the text. |
| Regular Expression | Enum value | Title matches the text as an Unreal regular expression. |
All comparisons except Regular Expression ignore letter case. The first window that matches is captured.
Content
| Asset | Type | Purpose |
PlaneActor/WindowCastPlane | Asset | Actor Blueprint (parent AWindowCastActor) that shows the capture on a plane mesh. |
PlaneActor/WindowCastPlaneMesh | Asset | Plane static mesh used by the sample actor. |
PlaneActor/WindowCastMat | Asset | Material with a Texture parameter that receives the capture. |
PlaneActor/WindowCastDefaultTex | Asset | Texture shown until the first frame arrives. |
Widget/WindowCastUMG | Asset | Widget Blueprint (parent UWindowCastWidget) that shows the capture in an image. |
Widget/WindowCastUMGMat | Asset | Material with a Texture parameter used by the sample widget. |
Widget/WindowCastUMGDefaultTex | Asset | Texture shown in the widget until the first frame arrives. |
Troubleshooting
| Symptom | Cause and fix |
| The default texture stays on screen | No window matched. Check the LogWindowCast log for "Target window not found", correct Capture Target Title or use Partial Match. The window is searched once per Start: if it was opened later, call Start again. |
| "CaptureTargetTitle is empty" in the log | Set Capture Target Title before calling Start. |
| The image freezes after the window is resized | A new texture is created on resize. Always display the texture passed to Change Texture instead of keeping the first one. |
| The wrong window is captured | Several windows match; the first match wins. Use Perfect Match or a Regular Expression that is specific to the window. |
| Nothing is captured on a target PC | Window capture needs Windows 10 version 1903 or newer. |
Build error about Windows.Graphics.Capture.Interop.h | Install a Windows 10 SDK 10.0.18362 or newer and rebuild. |
| A game module fails to build for other platforms | WindowCast exists only on Win64. Add the module dependency only for Win64 and guard the code with #if PLATFORM_WINDOWS. |
| A coloured border appears around the captured window | The border is drawn by Windows while a window is being captured; the plugin uses the default capture session settings. |