cbop - Win32 Clipboard Operations

Last modified:11 Oct 2011 by John Pallister

This is a small Windows program I've written that can copy text from a file to the clipboard, and paste text from the clipboard to a file.

I wrote this because I want to write scripts for the LSL language used by the Second Life online virtual world. The "standard" toolchain has "copy the source from Notepad" as one of the steps, so I thought a program like this might be useful to save us all a little time. As it turns out, someone had already done this, but the exercise has proved useful from a "here's a small example of the sort of code I produce" point of view.

The first version I wrote, cbop.cpp, is very proper and correct (IMHO) and can handle I/O from/to standard input/output. It also compiles to 176kB (using Visual C++ 6), even when optimised for size. So I re-wrote it quickly as a C program, which had two-thirds as many lines and compiled to only 44kB, although there's no standard input/output handling.

Usage: cbop command filename, where command is /copy or /paste and filename can be - for the C++ version, in which case the clipboard text is read from stdin or written to stdout.

Anyway, here are the files.

FilenameSizeDateDescription
cbop.exe [an error occurred while processing the directive] 03 Oct 2004 C version, Release build. Smallest, no stdio read/write.
cbop.exe [an error occurred while processing the directive] 03 Oct 2004 C++ version, Release build. Bigger, but can read & write to stdio.
cbop-source.zip [an error occurred while processing the directive] 404 Not Found

404 Not Found


nginx/1.24.0 (Ubuntu)
Source & Visual C++ 6 project file.