Skip to content

screen capture and recording of a specified 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
  2. 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.

  3. then it is possible to 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).

  1. 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, it is possible to specify it by invoking SetWindowRecordingByHandle and passing the window handle returned by the OnEnumerateWindows event.

Starting the window recording

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