CLIPSTAC (Version 1.0) Copyright (c) 1992 PC Magazine
Richard Hale Shaw August 1992 (Utilities
The Windows Clipboard over writes its entire contents the moment you
copy a fresh piece of text or cut a second image to it. The Clipboard can
hold one and only one item at a time; it is absolutely unforgiving.
And, as you may have found, it takes just one accidentally lost cut to
make you wish the Clipboard could accommodate multiple items.
CLIPSTAC eliminates this dangerous limitation. CLIPSTAC creates a
stack, or history list, of all the texts and bitmaps that any program cuts
or copies to or from the Clipboard. It saves all these items in a file,
CLIPSTAC.DAT, from which you can copy items back to the Clipboard by
selecting the desired entry from a list box.
Thus, anything you put onto the Clipboard can be retrieved and
reused, day after day, from one Windows session to another. This not only
safeguards your work, but makes the Clipboard a natural place to store
and access frequently used logos, boilerplate texts, and the like.
CLIPSTAC works equally well with both Windows 3.0 and 3.1.
If you wish to recompile the utility you'll need a ~C++ compiler
for Windows that supports templates. (I used Borland C++ 3.0; you can
also use Microsoft C 7.0 or Zortech C++ 3.0.)
CLIPSTAC requires no special syntax or parameters. You can add it
to a Program Group by choosing File, New from the Program Manager.
Or you can choose File, Run and execute it from the command line simply
by entering the following line:
Probably the best way to take advantage of CLIPSTAC, however, is
to set it up so that it loads whenever you run Windows. To do this, just
check the AutoLoad item in the CLIPSTAC System Menu. This will put the
full path of CLIPSTAC.EXE in the LOAD= entry of WIN.INI; each time
you start Windows thereafter, CLIPSTAC will run as a minimized program.
Alternatively, if you're using Windows 3.1, you can just add CLIPSTAC
to your Startup group.
To terminate CLIPSTAC, just select Close from its System Menu or
double-click on the CLIPSTAC System icon.
Once it's loaded, CLIPSTAC will open (or create) the CLIPSTAC.DAT
file in your Windows directory. If the Clipboard already has something
on it, CLIPSTAC will automatically retrieve a copy. (You can always
retrieve additional copies of items in the Clipboard using CLIPSTAC's
Paste button.) When you use CLIPSTAC to copy text or a bitmap to the
Clipboard, CLIPSTAC will automatically make a copy and store it in
The CLIPSTAC interface consists of a single dialog box with a list
box and several buttons. Whenever you copy a new item to the Clipboard,
a new entry is added to the beginning of CLIPSTAC's list, which is
displayed in the list box. Each entry displays the date and time that
the item was retrieved from the Clipboard, the format (text, bitmap,
and so on), the size of the item, and, when available, the name of the
program that put the item onto the Clipboard. For text items, CLIPSTAC
also displays the first 21 characters of text in its Contents field.
A program can have more than one Clipboard format, or version of
an item, in the Clipboard at a time. Because CLIPSTAC always retrieves
as many different item formats as are available, the same item will
often appear (under different formats) more than once in CLIPSTAC's
list. This is particularly true with text items, for which two character
sets are available.
Typically, the program that puts an item onto the Clipboard is the
Clipboard owner. But some programs (Notepad is one) do not access the
Clipboard themselves; they use Windows' USER.DLL to accesss the Clipboard
for them. In such a case the Clipboard owner will be the "User."
You can select an item in CLIPSTAC's list by single-clicking on
it with the mouse. (To select from the keyboard, Tab to the list and
use the Arrow keys within the list.) Pressing the Copy button when an
item is selected (highlighted) will copy that item from CLIPSTAC's list
back onto the Clipboard. (Double-clicking on an item will accomplish
the same thing.) Note that when you copy an item from CLIPSTAC to the
Clipboard, CLIPSTAC will sense the change in the Clipboard and recopy
the item to the top of its list--just as it would if any other program
had changed the Clipboard's contents.
The Delete button removes a selected item from the list. The Paste
button adds the item currently in the Clipboard to the top of CLIPSTAC's
list. This is the same action that CLIPSTAC takes automatically when you
change the Clipboard's contents. Paste, however, provides a convenient
way to retrieve more than one copy of an item into CLIPSTAC's list
without having to recopy it back onto the Clipboard from the program
that put it there.
A QUICK TUTORIAL
As all experienced Windows users probably know, you don't need to
display the contents of Clipboard in order to make use of it. The
Clipboard functions are available to applications whenever Windows is
running. What you activate when you double-click on the Clipboard icon
(or run CLIPBRD.EXE) is only the Clipboard Viewer. I suggest that you
keep the Windows Clipboard Viewer open during your first experiments
with CLIPSTAC so that you can monitor the Clipboard's contents at each
step. You will also want to have CLIPSTAC open, of course, as well as
a simple text editor (Notepad will do). It may take a little juggling
to get them all on-screen at once, but the effort will be well spent.
Start by opening a file or typing some text into the Notepad
window and using the mouse to select it. (You can also select text in
the window by holding down the Shift key while you move the cursor to
the end of the desired text.) Then use Edit, Copy or, from the keyboard,
Ctrl-C (Ctrl-Ins in Windows 3.0) to copy the highlighted text to the
Clipboard. Alternatively, you can use Edit, Cut or Ctrl-X (Shift-Del
in Windows 3.0) to cut the text from the editor to the Clipboard.
As soon as you cut or copy text to the Clipboard, an entry representing
that text will appear in CLIPSTAC's list box, as described previously.
Now delete the text in the Clipboard and from the application so you
know that it is only available from CLIPSTAC.
To retrieve the text from CLIPSTAC back into your application,
double-click on the text's entry in CLIPSTAC's list box. (Alternatively,
you can single-click on the entry and press CLIPSTAC's Copy button.)
This will put the item from CLIPSTAC back onto the Clipboard. Then return
to the target application, position the cursor where you want the text
to be inserted, and select Edit, Paste or Ctrl-V (Shift-Ins in
Windows 3.0). Voila! The text will reappear in the target application's
To copy a bitmap from an application into CLIPSTAC, you use a
procedure similar to the one you use for text. For example, to copy a
bitmap from Paintbrush into CLIPSTAC, open Paintbrush and select File,
Open to open a bitmap file (such as 256COLOR.BMP). Select the icon in
the upper-right corner (the one with the scissors and a square) and
select a portion of the bitmap. (Click and hold the mouse button at one
corner of the bitmap and drag the mouse to the other end of the bitmap,
then release the mouse button.)
Then use Edit, Copy (Ctrl-C or Ctrl-Ins) to copy the bitmap onto
the Clipboard and so into CLIPSTAC. CLIPSTAC will display a new entry
for the bitmap, though the Contents field will contain only dots. Clear
the Clipboard once again to assure yourself that you're really making a
copy from CLIPSTAC to the Clipboard in the next step.
Now, to copy the bitmap from CLIPSTAC onto the Clipboard,
double-click on the bitmap entry in CLIPSTAC's list (or single-click
it and press the CLIPSTAC Copy button). Then paste the bitmap from the
Clipboard back into Paintbrush by activating Paintbrush, positioning the
cursor where you want the bitmap to go, and using Edit, Paste (Ctrl-V
MORE ON CLIPSTAC
You'll notice when using CLIPSTAC that if you have more than ten
entries in its list, you will not see new entries being added. The top
of CLIPSTAC's list has simply scrolled off-screen. When this happens,
a scroll bar will appear; you can use this to scroll through the list
to the top of the stack. Whenever the top of the list is visible you'll
see new items as they are added.
CLIPSTAC limits the number of items you can store in its list.
The default is 500, but you can set a lower limit by making an entry in
WIN.INI, as described below. This may be wise, especially if you use it
for bitmaps; CLIPSTAC.DAT can easily grow beyond several megabytes if
you use it to store many different bitmaps.
Items that you don't use again will eventually fall off the end of
the list. That is to say, when you add the 501st item, the item at the
bottom of the list will be discarded automatically. But whenever you use
an item--that is, copy it from CLIPSTAC's list back onto the Clipboard--
that item will also be copied to the beginning of the list. This safeguard
will generally be enough to prevent a frequently used item from falling
off the end of the list.
Just to be sure, however, CLIPSTAC provides a ToTop button. When you
press this button, the selected CLIPSTAC item is copied to the top of its
list without being copied to the Clipboard, where it would overwrite the
current Clipboard contents. (Of course, this will push every item in the
list down one notch.)
An additional CLIPSTAC feature helps deal with the disk-space
problem that arises if you frequently use bitmaps. To appreciate the
problem, press the Print Screen key while CLIPSTAC is running to copy a
bitmap of the entire Windows desktop onto the Clipboard. (Depending on
your computer, you may have to hit Print Screen twice, Shift-Print
Screen, or Alt-Print Screen, as the Windows manual suggests.) CLIPSTAC's
cursor will change to an hourglass while it copies the bitmap from the
Clipboard into CLIPSTAC.DAT. When the bitmap entry appears in CLIPSTAC's
list, you'll find that CLIPSTAC.DAT may be anywhere from 150K to a full
megabyte, depending on your system's video resolution. All it takes is
three or four of these and CLIPSTAC.DAT will balloon to several megabytes
of valuable disk space.
To prevent this, wherever possible CLIPSTAC duplicates the
information about a list item without duplicating the item itself. Thus,
you don't have to worry about CLIPSTAC.DAT's size exploding if you
frequently use Copy or ToTop. You can prove this to yourself by hitting
the Copy button several times when the desktop bitmap you just made is
highlighted. Now use the File Manager (or DIR in a DOS window) to check
the size of CLIPSTAC.DAT. It will have increased only by the size of the
original bitmap, not by the size of the additional copies.
You can control the number of items in CLIPSTAC's list in two ways.
First, of course, you can use the Delete button to remove selected items
from the list. As mentioned earlier, however, you can also reduce the
default maximum number of items in the list by adding the MaxItems entry
to the [ClipStac] section of WIN.INI. (CLIPSTAC will automatically create
this section the first time you run it.)
Thus, you might enter
to limit the number of entries in CLIPSTAC's list to 100. Whenever the
number of CLIPSTAC items exceeds 500 (or the MaxItems setting, whichever
is smaller), CLIPSTAC will drop the item at the end of the list. The
CLIPSTAC About box reports the current number of items in the list; just
select About ClipStac from CLIPSTAC's System Menu.
Whether a CLIPSTAC item falls off the end of the list or you use
the Delete button to remove it, the item is not immediately removed from
the CLIPSTAC.DAT file. As with many of the popular PC database programs,
you must occasionally pack CLIPSTAC's data file to remove deleted items
from the file and recover the disk space they occupied. When you press
the Pack button, CLIPSTAC will write out a new copy of CLIPSTAC.DAT that
contains only those items that are current in the list. And, wherever an
item was created via the Copy or ToTop buttons, only a single copy of
that item will remain in the entire data file.
Note that, as with PC database programs, packing can take some time,
especially if CLIPSTAC's list gets large or contains large items. If you
find yourself using Pack during every CLIPSTAC session, you can check
the AutoPack option in CLIPSTAC's System Menu. This will cause CLIPSTAC
to pack CLIPSTAC.DAT automatically each time you start the program.
Richard Hale Shaw is a contributing editor to PC Magazine.