Skip to content

screen capture and recording of a specified window

A single window can be recorded, instead of the whole screen.

There are 2 constraints:

  • the window must not be resized after the recording starts,
  • the window must not be overlapped by another window.

Identifying the video window to record

The component must be told which window to record. This can be done in 2 ways.

Simple way

Identify the name of the window to record by looking at its title bar, and invoke SetWindowRecordingByName by passing the whole title, or only a substring that identifies it:

  • either pass the full string to the WindowName parameter, with ExactMatch = true,
  • or pass a substring picked up in the window name, with ExactMatch = false (in this case the string is not case-sensitive).

Advanced way

Use EnumerateWindows to retrieve the window name.

After EnumerateWindows is invoked, the OnEnumerateWindows event occurs for each visible window, and returns:

  • the window name,
  • the name of the class of the window,
  • the window handle.

Then, after choosing the window, specify it by invoking SetWindowRecordingByHandle with the window handle returned by the OnEnumerateWindows event.

Starting the window recording

Window destroyed during preview or recording

If the window is destroyed during preview or recording, the preview or recording stops.

Screen capture and recording of non-visible (hidden) windows

To capture non-visible windows, enable the ScreenRecordingNonVisibleWindows property.

Note

This mode may give variable results depending on the content of the window.