Compartilhar via


Using the Clipboard to streamline XPe component handling

Overview

At times, building a component in Component Designer involves typing in a long list of dependencies, registry keys or files that someone else already typed in. Using the Clipboard Viewer (a rather obscure feature of Windows XP), it is possible to cut down on some of that typing by saving “snippets” of information in Clipboard files (*.CLP). This article explains this process.

The short of it

When you copy anything into Window’s clipboard, you can use the CLIPBRD.EXE utility (part of XP Pro) to view, save or restore the contents of the clipboard. This applies to any content – including anything you can copy from within Component Designer by using “Edit/Copy” on the menu!

Exporting Clipboard files

To create a .CLP file, follow the steps below:

1.       Select a list of components, files or registry keys in Component Designer (using shif-click or shif-arrows) that you would like to save into a .CLP file for someone else to use;

2.       Copy those contents into the clipboard using “Edit/Copy”, the context menus (right-click, then “Copy”) or shortcut keys;

3.       Open CLIPBRD.EXE (from Start/Run, since there’s no entry in the Start menu). Your content will be in CLIPBRD – even though sometimes it can’t be rendered to the screen, because CLIPBRD doesn’t understand Component Designer’s data format;

4.       In CLIPBRD.EXE, use “File/Save As…”.

Importing Clipboard files

Here’s how to import a .CLP file into Component Designer:

1.       Have Component Designer open and focused on the component you want to paste the saved clipboard contents into.

2.       Use Start/Run and open CLIPBRD.EXE – don’t worry about any messages it gives you regarding the ClipBook service, you don’t need that.

3.       Open your .CLP file (which you saved using the instructions in the previous section) in CLIPBRD. If it prompts you to clear the clipboard, click “yes”. This has the same effect as copying the dependencies from Component Designer. The clipboard view will show the message “ClipBook Viewer cannot display the information in its current format. To view the information, try pasting it into a document”. This message is normal – pasting is exactly what we want to do.

4.       In Component Designer, select the specific node within your component where your clipboard contents are to be pasted (such as “Component or Group Dependency”) within your component in Component Designer. Then right-click an empty spot on the right pane and choose “Paste” – or use “Edit/Paste”. 

Note that the “Paste” menu option is grayed out if the contents of the clipboard don’t match the selected pane – obviously, you can’t paste a set of registry keys into the “dependencies” pane..

- Alex