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:
- Form is created and positioned
- User presses configured hotkey (Ctrl+Shift+Q)
- OnCaptureHotkey event fires
- User moves cursor over target window
- InfoLabel displays window information
- User clicks to capture window handle
- 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, IContainerControlInheritance
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
CapturedWindowHandle
Gets captured window handle.
public nint CapturedWindowHandle { get; }Property Value
CapturedWindowText
Gets capture window text.
public string CapturedWindowText { get; }Property Value
DefaultBorderColor
Gets or sets default border color.
public Color DefaultBorderColor { get; set; }Property Value
InfoLabel
Gets info label.
public Label InfoLabel { get; }Property Value
MoveByMouseDown
Gets or sets a value indicating whether window moved by mouse button down.
public bool MoveByMouseDown { get; set; }Property Value
Methods
Dispose(bool)
Clean up any resources being used.
protected override void Dispose(bool disposing)Parameters
disposingbool-
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
hotkeyKeys[]-
The hotkey.
UpdateLocation(Rectangle)
Updates location.
public void UpdateLocation(Rectangle rect)Parameters
rectRectangle-
Rectangle.
OnCaptureHotkey
OnCaptureHotkey event.
public event EventHandler<WindowCaptureEventArgs> OnCaptureHotkey