Table of Contents

Class ClipboardHook

Namespace
NetEx.Hooks
Assembly
NetEx.Hooks.dll

Provides a mechanism for hooking all clipboard events within the operating system.

public static class ClipboardHook
Inheritance
ClipboardHook
Inherited Members

Remarks

There are three ways of monitoring changes to the clipboard. The oldest method is to create a clipboard viewer window. Windows 2000 added the ability to query the clipboard sequence number, and Windows Vista added support for clipboard format listeners. Clipboard viewer windows are supported for backward compatibility with earlier versions of Windows.

On Windows Vista and later, ClipboardHook will create a Clipboard Format Listener to listen for clipboard updates. On earlier versions it will create a Clipboard Viewer Window instead.

Properties

IsInstalled

Indicates whether ClipboardHook has been installed and is capturing clipboard events.

public static bool IsInstalled { get; }

Property Value

bool

true if the hook is installed and valid; otherwise false.

Methods

Install()

Installs the clipboard hook, capturing all clipboard events.

public static void Install()

Exceptions

Win32Exception

The hook could not be installed.

TryInstall()

Attempts to install the clipboard hook.

public static bool TryInstall()

Returns

bool

true if the hook was successfully installed; otherwise false.

TryUninstall()

Attempts to uninstall the clipboard hook.

public static bool TryUninstall()

Returns

bool

true if the hook was successfully installed; otherwise false.

Uninstall()

Uninstalls the clipboard hook, and stops further clipboard events from being captured.

public static void Uninstall()

Exceptions

Win32Exception

The hook could not be uninstalled.

Events

ClipboardUpdated

Occurs when data is placed onto the clipboard.

public static event ClipboardUpdatedEventHandler? ClipboardUpdated

Event Type

ClipboardUpdatedEventHandler