Class ClipboardHook
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
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
TryUninstall()
Attempts to uninstall the clipboard hook.
public static bool TryUninstall()
Returns
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