Clipboard Viewer Component
| Release: | 1.3 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Date: | 17 Aug 2008 | ||||||||||||||||||||||||
|
Delphi Compatibility:
|
|
- Overview
- Download
- Install Info
- Change Log
- License
Overview
TPJCBView is a non-visual Delphi component which registers a hidden window as a "clipboard viewer".
This means that Windows notifies the component whenever the clipboard contents change. On receipt of these notifications the component triggers an event. By handling the event your application can respond to changes on the clipboard. The component can be used as the heart of a program that displays "live" information about the clipboard. Alternatively it can simply enable and disable other components whose state depends on the available clipboard formats.
TPJCBView provides an Enabled property that is used to enable and disable the component and hence it's events. It also has a TriggerOnCreation property that triggers an event when the control is created.
How it works
TPJCBView works by registering its hidden window with Windows. This
is accomplished by using the SetClipboardViewer API call that adds
the window to the clipboard chain. The component then handles the
WM_DRAWCLIPBOARD message that Windows sends to the hidden
window when the clipboard changes. The WM_CHANGECBCHAIN message
that indicates when the viewer chain has changed is also handled.
Two of my articles provide details of two of the key techniques used in developing this component:
- "How to get notified when the content of the clipboard changes" is self-explanatory; while
- "How a non-windowed component can receive messages from Windows" shows how to create a hidden window to enable a non-visual component to receive Windows messages.
Help files
An OpenHelp compatible help file is provided that can be integrated into the IDE in Delphi 3 to 7. The help file is not compatible with Delphi 2 or the Borland Development System.



