screen capture and recording of a specified window




Screen recording of a window


Screen recording of a window

It is possible to record only a window, instead of the whole screen.

There are 2 contraints:
- the window may not be resized after the recording starts,
- the window must not be overlapped by another window.

Identifying the video window to record

It is necessary to specify to the component the window to be recorded.
This can be achieved by 2 ways.

1. simple way
- identify the name of the window to record by looking at its title bar, and invoke SetWindowRecordingByName by passing the whole title bar, or only a substring that identifies it.
- then you can pass:
. either the full string to the WindowName parameter with ExactMatch = true
. either a substring picked up in the window name, with ExactMatch = false (in this case the string is not case-sensitive).

2. advanced way
Use EnumerateWindows to retrieve the window name.
After invoking EnumerateWindows, the OnEnumerateWindows will occur for each visible window, and will return:
- the window name
- the name of the class of the window
- the window handle

Then, after choosing the window, you can specify it by invoking SetWindowRecordingByHandle and passing the window handle returned by the OnEnumerateWindows event.

Starting the window recording

- specify the window to record by using the 1. or 2. method above,
- set VideoSource = vs_ScreenRecording
- invoke StartRecording to record, or StartPreview and then CaptureFrameTo to make single window captures.

Window is destroyed during preview or recording

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

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

It is possible to enable the capture of non-visible windows by enabling the ScreenRecordingNonVisibleWindows property.
Note: this mode may give variable results depending on the content of the window