TPJCBViewer Component


Contents


License & Disclaimer

This component is copyright © P.D.Johnson, 1999.

The source code and help files can be freely distributed on a not-for-profit basis providing that:

  1. the source code is not altered.
  2. this readme file is distributed with it unchanged

By not-for-profit I mean that you may recover out of pocket expenses incurred in distributing the code, but should not make a profit from this.

If you discover any bugs in this implementation, or if you have any update suggestions, please contact me on peter.johnson@openlink.org.

Please do modify the code for you own use. I'd like to see any changes you make - I could incorporate them into future versions. Please notify me of changes on at the above e-mail address.

This software is provided as is - no warranty is given as to its suitability for any purposes to which you may wish to put it.


Description

This is a non-visual Delphi component.

It registers a hidden window as a "clipboard viewer" which means that the component is notified by Windows of any changes to the contents of the clipboard. 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 or simply to enable and disable other components that should only be enabled when the clipboard has valid contents.

The component provides an Enabled property to switch its event triggering on and off and a TriggerOnCreation property that causes the event to be triggered when the control is created, regardless of whether the clipboard has changed at that time.


Compatibility

The component has been tested under Delphi 1 and Delphi 2. It may work correctly in Delphi 3 and 4 but this has not been tested.


Installation

These instructions assume that you have created a sub-directory cbview into which you can un-pack the files contained in cbview.zip.

Installation with Delphi 1

To install the component for Delphi 1 proceed as follows. These instructions assume that your Delphi 1 installation is installed in a sub-directory called delphi.

  1. Unzip the file cbview.zip into a folder, preserving the directory structure.
  2. Copy the file cbview.pas to the folder from where you wish to install it into the Delphi Component Palette (this will probably be an existing folder where you keep the library components - say the default delphi\lib sub-folder of your Delphi installation).
  3. Copy cbview.dcr from the delphi1 sub-folder into the same place that you copied cbview.pas.
  4. Copy the help file cbview.hlp into the delphi\bin folder
  5. Copy the help keyword file cbview.kwf into the delphi\help folder.
  6. Ensure Delphi is not running. Merge the help keyword file by running helpinst.exe from the delphi\help folder. When helpinst.exe is running open the delphi.hdx file and add cbview.kwf and click on the Save button.
  7. Start Delphi. Select the Options | Install Components menu option. Click the Add button, then the Browse button and navigate to the cbview.pas file in the directory where you placed it. Click OK to recompile the components directory. You can now delete cbview.pas from the place where you copied it if you wish. The component will appear on a palette called PJ Stuff. You can move the component to a different palette as required, or hack the source code (before installing the program) by finding the Register procedure at the end of the code and changing the string 'PJ stuff' to the name of the required palette.

Installation with Delphi 2

To install the component for Delphi 2 proceed as follows. These instructions assume that your Delphi 2 installation is installed in a sub-directory called Delphi 2.0.

  1. Unzip the file cbview.zip into a folder, preserving the directory structure.
  2. Copy the file cbview.pas to the folder from where you wish to install it into the Delphi Component Palette (this will probably be an existing folder where you keep the library components - say the default Delphi 2.0\lib sub-folder of your Delphi installation).
  3. Copy cbview.dcr from the delphi2 sub-folder into the same place that you copied cbview.pas.
  4. Copy the help file cbview.hlp into the Delphi 2.0\help folder
  5. Copy the help keyword file cbview.kwf into the Delphi 2.0\help folder.
  6. Merge the help keyword file by running helpinst.exe from the Delphi 2.0\help\tools folder. When helpinst.exe is running open the delphi.hdx file and add cbview.kwf and click on the Save button.
  7. Start Delphi. Select the Options | Install Components menu option. Click the Add button, then the Browse button and navigate to the cbview.pas file in the directory where you placed it. Click OK to recompile the components directory. You can now delete cbview.pas from the placed where you copied it if you wish. The component will appear on a palette called PJ Stuff. You can move the component to a different palette as required, or hack the source code (before installing the program) by finding the Register procedure at the end of the code and changing the string 'PJ stuff' to the name of the required palette.


Known Issues

None reported.


About the Author

I'm Peter Johnson - a hobbyist programmer living in Ceredigion in West Wales, UK. I write mainly in Delphi, but occasionally dabble in C, C++ and Java. My programs are available for download on my web-site: http://homepages.tesco.net/~p.d.johnson/

I can be contacted by e-mail on peter.johnson@openlink.org.