Posts Tagged ‘nbClipboard’

nbClipboard – a clipboard extender

Sunday, October 19th, 2008

Overview

nbClipboard adds stack, queue and simple text transformations to the Windows clipboard when using the clipboard’s keyboard shortcuts.

As well as storing successive clipboard items in either a queue or a stack nbClipboard can perform search/replace operations on the clipboard data and can automatically convert the text to either upper or lower case.

This tool can be left running in the background or you can make the window stay on top or become transparent.

It is necessary to have the .NET framework version 3.0 installed for nbClipboard to work. Version 3.0 of the framework is pre-installed on Windows Vista and can be downloaded from Microsoft’s website as an additional download for Windows XP.

Download

You can download nbClipboard from this link: nbClipboard – installer download – (333kb)

Manual

Introduction

nbClipboard is a simple tool that adds stack and queue support as well as basic text transformations to the Windows clipboard when using the clipboard’s keyboard shortcuts.

As well as storing successive clipboard items in either a queue or a stack nbClipboard can perform search/replace operations on the clipboard data, and can automatically convert the text to either upper or lower case.

This tool can be left running in the background or you can make the window stay on top or become transparent.

It is necessary to have the .NET framework version 3.0 installed for nbClipboard to work. Version 3.0 of the framework is pre-installed on Windows Vista and can be downloaded from Microsoft’s website as an additional download for Windows XP.

Installation

To install double-click on the install executable and follow the instructions. nbClipboard requires version 3.0 or above of the .NET framework. This can be downloaded from Microsoft’s .NET Download page.

Usage

Launch nbClipboard from the Start menu.

When it is loaded you will be see the main configuration screen. From here you can turn the clipboard queue or stack on, and can set the text transformation settings.

If you want to work with non-text clipboard data (files, photo data etc.) you should close nbClipboard as nbClipboard will case problems with non-clipboard data.

Clipboard queue and stack

The clipboard queue and stack allow multiple items to be copied to the the clipboard and then pasted in order.

The queue will paste items in the same order they are copied.

Example: You copy the following items of text – ‘one’, ‘two’, ‘three’, ‘four’. When you paste them they are pasted in this order – ‘one’, ‘two’, ‘three’, ‘four’.

The stack will paste items in the reverse order to what they are copied. i.e. the last item to be copied to the clipboard will be the first item to be pasted.

Example: You copy the following items of text – ‘one’, ‘two’, ‘three’, ‘four’. When you paste them they are pasted in this order – ‘four’, ‘three’, ‘two’, ‘one’.

Note

nbClipboard will only add text to the queue or stack when the copy and paste operations are performed using the keyboard shortcuts. It will not operate when copy and paste operations are caried out using the mouse.

Text transformations

To upper / lower case

Text which has been copied can automatically be converted into either upper or lower case.

Text replacements

You can do an automatic search / replace operation on any pasted text. You can choose to make the search case sensitive by ticking the ‘Match case’ box.

Note

The text transformations will only be applied when the text is pasted using the keyboard paste shortcut. It will not work when text is pasted from a menu.

List of copy / paste keyboard shortcuts

Copy Ctrl-C Ctrl-Insert
Paste Ctrl-V Shift-Insert
Cut Ctrl-X Shift-Delete

Limitations

nbClipboard currently only deals with plain text. Therefore whilst it is running any rich text items copied, or non-text items copied to the clipboard may lose their formatting.

Revision History

  • 1.1.0 – Fixed case-insensitive search and replace bug where only the first occurance would be replaced.
  • 1.0.0 – Initial version

Credits

Portions of nbClipboard are based on the Global System Hooks tutorial by Michael Kennedy.

Installer created using ISTool.

Table of contents generated with hypertoc.

If you are interested in the background of this tool you can read my Writing and releasing a free software tool in two weeks post.


Writing and releasing a free software tool in two weeks

Tuesday, May 27th, 2008

Two weeks ago I started a mini-project to write a simple piece of software in C#, package it up and release it. Although I had initially given myself two weeks, the actual time I spent on this project was less than a week due to a pest problem, a birthday, and a family visit. The purpose of this project was to learn the basics of a new programming language, and to learn how to package and release the initial version of a new piece of simple software.

Picking a language

I had never written a line of C# in my life but knew that it had similarities to both C++ and Java. I’ve been programming with C++ and Java professionally (by which I mean that someone pays me to do it) for many years so it seemed an interesting new language to experiment with.

I downloaded the free Microsoft Visual C# 2008 Express Edition and installed it. I followed the initial tutorial to learn how to build a very basic application and then started experimenting with adding new features.

Visual C#

Version control

The version control system that I am used to working with is Perforce. I therefore wanted to use a different version control system for this project (remember this is a learning exercise so I want to try new technologies!).

I picked the well known subversion as the version control tool with TortoiseSVN as the front end to subversion. Subversion is a popular choice and is easy to use if you are used to using something like Perforce. It has many differences but also many similarities.

tortoisesvn

What to write?

I had decided to write a Windows clipboard extender. There are loads of other clipboard extenders available but that didn’t worry me. My goal isn’t to create something original, just something that I would use myself.

The core features that I wanted to include was stack and queue support for the clipboard. Normally copying an item of text to the clipboard overwrites the previous item. I wanted the previous values to be stored in either a queue or a stack. e.g.

I copy (using Ctrl-C) the values ‘one’, ‘two’, ‘three’.
I then paste (using Ctrl-V) and the pasted values are ‘one’, ‘two’ and then ‘three’. This is the queue behaviour.
If using the stack the pasted values would be ‘three’, ‘two’ and finally ‘one’.

Online help with writing the software

As I was completely new to C# and its APIs, I had to do a lot of searching to find out how to do Clipboard operations. The Visual C# help system was also very good.

There is a huge amount of help for almost any C# problem you can think of on the internet so it wasn’t hard to find out how to solve any problem that I had. In particular the following articles were very helpful:

  1. Create a Windows Clipboard Monitor in C# using SetClipboardViewer
  2. Global System Hooks in .NET

Writing a EULA

When releasing software you would normally ship an end-user licence agreement (EULA) along with the software. This tell the user what they can and can’t do with your software.

If you want to open source your software there is a good source of licensing information at the Free Software Foundation.

In my case I wanted the software to be free to use but proprietary (I’m not shipping the source). It is harder to find information on how to produce a licence in this case. One option is to look at existing licences and adapt any bits you like. I used the XS EULA Generator (update: sadly the tool no longer exists) and then adapted it for my needs.

Creating an install package

Once I had written my clipboard extender (which I named nbClipboard) I needed some way to package it up with a Windows installer.

After looking around the best option seemed to be Inno Setup combined with ISTool (a front end for Inno Setup). You can download both together by going to the Inno Setup website and downloading the QuickStart Pack.

ISTool

This creates a professional looking software install executable which looks identical to the install tools used by many popular software applications.

nbClipboard setup wizard

Making a PAD file

To release software you can add it to your own website and in addition you may want it to be added to the many software download websites out there. Almost all software download websites require you to submit a PAD file (Portable Application Description). This file describes all the attributes of your software (purpose, author, screenshots, OS requirements etc) in a standard format which allows these download sites to stay up to date.

The format was created by the Association of Shareware Professionals (ASP) and they have a free PADGen tool that you can use to create the PAD file.

padgen

Releasing the software

After creating the install package and the PAD file I uploded both of them to my website and then submitted the PAD file to the ASP repository (a store of PAD files that many software download sites use as a data source).

Just two hours after making the submission nbClipboard had appeared on two download sites and was even appearing in the Google search results as a result of one of these download sites being indexed. In the next few days it appeared on other download sites as well. You may want to note that the sites that pick these PAD files up automatically seem to be the small download sites. If you want your software to appear on better known directories such as Tucows and download.com you’ll need to handle the submission manually.

nbClipboard

nbClipboard is available from the below link and it might be available from some small software download sites as well – if you can find them!

nbClipboard Clipboard Extender

nbClipboard - adds queue and stack support to the Windows clipboard

It certainly won’t win any awards but then I was more interested in going through the whole process of writing and releasing a new software tool than creating something which was ground breaking.