Table of Contents

Class WindowCaptureForm

Namespace
VisioForge.Core.UI.WinForms.Dialogs
Assembly
VisioForge.Core.dll

A specialized WinForms dialog for interactively selecting and capturing application windows.

This borderless, semi-transparent form provides a visual interface for selecting windows to capture by hovering over them with the mouse cursor. When activated via a global hotkey, it displays a camera crosshair overlay and allows users to click on any window to capture its handle and properties. The selected window can then be used as a capture source for screen recording or streaming applications.

Key features:

  • Global hotkey activation (default: Ctrl+Shift+Q)
  • Semi-transparent camera icon cursor overlay
  • Real-time window information display
  • Parent window capture support
  • Configurable border color for selection feedback
  • Mouse drag repositioning capability
  • Non-intrusive fuchsia transparency key

Architecture:

  • Borderless form with transparency for overlay effect
  • Global keyboard hook for hotkey detection
  • Real-time cursor position tracking
  • Win32 API integration for window enumeration

Usage workflow:

  1. Form is created and positioned
  2. User presses configured hotkey (Ctrl+Shift+Q)
  3. OnCaptureHotkey event fires
  4. User moves cursor over target window
  5. InfoLabel displays window information
  6. User clicks to capture window handle
  7. CapturedWindowHandle and CapturedWindowText properties are set

Threading: All operations should occur on the UI thread. Global keyboard hook events are marshaled appropriately.

public class WindowCaptureForm : Form, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

WindowCaptureForm()

Initializes a new instance of the VisioForge.Core.UI.WinForms.Dialogs.WindowCaptureForm class.

public WindowCaptureForm()

Properties

CaptureParentWindow

Gets or sets a value indicating whether to capture parent window.

public bool CaptureParentWindow { get; set; }

Property Value

bool

CapturedWindowHandle

Gets captured window handle.

public nint CapturedWindowHandle { get; }

Property Value

nint

CapturedWindowText

Gets capture window text.

public string CapturedWindowText { get; }

Property Value

string

DefaultBorderColor

Gets or sets default border color.

public Color DefaultBorderColor { get; set; }

Property Value

Color

InfoLabel

Gets info label.

public Label InfoLabel { get; }

Property Value

Label

MoveByMouseDown

Gets or sets a value indicating whether window moved by mouse button down.

public bool MoveByMouseDown { get; set; }

Property Value

bool

Methods

Dispose(bool)

Clean up any resources being used.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true if managed resources should be disposed; otherwise, false.

StartCapture()

Starts capture.

public void StartCapture()

StopCapture()

Stops capture.

public void StopCapture()

UpdateHotkey(Keys[])

Creates the hotkey hook.

public void UpdateHotkey(Keys[] hotkey)

Parameters

hotkey Keys[]

The hotkey.

UpdateLocation(Rectangle)

Updates location.

public void UpdateLocation(Rectangle rect)

Parameters

rect Rectangle

Rectangle.

OnCaptureHotkey

OnCaptureHotkey event.

public event EventHandler<WindowCaptureEventArgs> OnCaptureHotkey

Event Type

EventHandler<WindowCaptureEventArgs>