3.4 The .rad File

only for RuBoard - do not distribute or recompile

3.4 The .rad File

The shell extensions discussed throughout this book will be developed for the mythical .rad file, which is just an imaginary file type I've used to demonstrate the concepts presented in the book. An existing file type could have been used instead, but by using a made-up type, we get to build everything from the ground up. If I had used an existing file type, many of the needed registry entries would already be in place, diminishing the "hands on" approach of the book. Changing registry settings for existing file types also has a tendency to change the way that Windows handles your applications, something you're not likely to appreciate. Also, chances are that you will be writing these extensions for your own file types, not for someone else's.

The format of a .rad file is exactly the same as an .ini file and looks like this:

 [Animal] Type = (dog, cat, fish, snake, cow, or armadillo) Gender = (M or F) Color = (Black, White, Gray, Brown, or Green) Age = (positive integer) Weight = (positive integer) 

You can think of a .rad file as an .ini file with a specific format. The animal types and file format have been purposefully simplified to keep the focus away from the file itself and on the shell extensions. It's not because of laziness . . . Anyway, if you suddenly find yourself with large amounts of free time that just can't be used productively anywhere else, by all means extend the file in any way you wish.

3.4.1 Registering the .rad File

The file association key and the application identifier key must be added to the registry for the .rad file. You can use rad.reg , which is included with the book's code (downloadable from http://vb.oreilly.com), or add it by hand. The keys are as follows :

HKEY_CLASSES_ROOT\.rad = radfile

This notation signifies that the default value for .rad is radfile . This is the file association key; it only serves as a pointer to radfile .

HKEY_CLASSES_ROOT\radfile = Rudimentary Animal Data

This is the root key for all shell extensions. The default value contains the description of the file type that will be displayed in Explorer.


All shell extensions for the .rad file will be listed under this key. This is where all of the action takes place.

only for RuBoard - do not distribute or recompile

Visual Basic Shell Programming
Visual Basic Shell Programming
ISBN: B00007FY99
Year: 2000
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net