Registering Commands:
Many of the commands found on icons,
including Send To, Cut, Copy, Paste, Create Shortcut, Delete, Rename, and Properties, are
provided by their container -- that is, their containing folder or the desktop. But you
must provide support for the icon's primary commands, also referred to as verbs, such as
Open, Edit, Play, and Print. You can also register additional commands that apply to your
file types, such as a What's This? command and even commands for other file types.
To add these commands, in the HKEY_CLASSES_ROOT key, you register a shell subkey and a
subkey for each verb, and a command subkey for each menu command name.
To add these commands, in the HKEY_CLASSES_ROOT key, you register a shell subkey and a
subkey for each verb, and a command subkey for each menu command name.
<k>HKEY_CLASSES_ROOT
</k> <e>ApplicationIdentifier</e> = <e>Type</e>
<e>Name </e> <k>shell</k> [ = <e>default</e>
<e>verb</e> [,<e>verb2</e> [,..]]<e> </e>
<e>verb</e> [ = <e>Menu</e> <e>Command</e>
<e>Name</e>] <k>command
</k> = <e>pathname</e> [<e>parameters</e>]
You can also register a DDE command string for a DDE command.
<k>HKEY_CLASSES_ROOT
</k> <e>ApplicationId</e><e>entifier</e> =
<e>Type</e> <e>Name </e>
<k>shell</k> [ = <e>default</e> <e>verb</e>
[,<e>verb2</e> [,..]]<e> </e> <e>verb</e> [ =
<e>Menu</e> <e>Command</e> <e>Name</e>]
<k>ddeexec</k> = <e>DDE</e> <e>command</e>
<e>string </e> <k>Application</k> = <e>DDE</e>
<e>Application</e> <e>Name</e> <k>Topic</k>
<e>=</e> <e>DDE</e> <e>topic</e> <e>name
</e><idx id=10_RGSTR.DOC-1124>
A verb is a language-independent name of the command. Applications may use it to invoke a
specific command programmatically. The system defines Open, Print, Find, and Explore as
standard verbs and automatically provides menu command names and appropriate access key
assignments, localized in each international version of Windows. When you supply verbs
other than these, provide menu command names localized for the specific version of Windows
on which the application is installed. To assign a menu command name for a verb, make it
the default value of the verb subkey.
The menu command names corresponding to the verbs for a file type are displayed to the
user, either on a folder's File drop-down menu or pop-up menu for a file's icon. These
appear at the top of the menu. You define the order of the menu commands by ordering the
verbs in the value of the shell key. The first verb becomes the default command in the
menu.
By default, capitalization follows how you enter format the menu command name value of the
verb subkey. Although the system automatically capitalizes the standard commands (Open,
Print, Explore, and Find), you can use the value of the menu command name to format the
capitalization differently. Similarly, you use the menu command name value to set the
access key for the menu command following normal menu conventions, prefixing the character
in the name with an ampersand (&). Otherwise, the system sets the first letter of the
command as the access key for that command.
To support user execution of a verb, provide the path for the application or a DDE command
string. You can include command-line switches. For paths, include a %1 parameter. This
parameter is an operational placeholder for whatever file the user selects.
For example, to register an Analyze command for an application that manages stock market
information, the registry entries might look like the following.
<k>HKEY_CLASSES_ROOT</k> <k>stockfile</k> = Stock Data
<k>shell</k> = analyze <k>analyze</k> = &Analyze
<k>command</k> = C:\Program Files\Stock Analysis\Stock.exe /A <idx
id=10_RGSTR.DOC-1126>
You may have different values for each command. You may assign one application to carry
out the Open command and another to carry out the Print command, or use the same
application for all commands This about Registry KEY's....
Registering Sound Events:
Your application can register specific events to which the user can assign sound files so
that when those events are triggered, the assigned sound file is played. To register a
sound event, create a key under the HKEY_CURRENT_USER key.
<k>HKEY_CURRENT_USER</k>
<k>AppEvents</k>
<k>Event</k> <k>Labels</k>
<e>EventName</e> = <e>Event</e> <e>Name
</e>
Set the value for EventName to a human-readable name.
Registering a sound event only makes it available in Control Panel so the user can assign
a sound file. Your application must provide the code to process that event.
Registering OLE:
Applications that support OLE use the registry as the primary means of defining class
types, operations, and properties for data types supported by those applications. You
store OLE registration information in the HKEY_CLASSES_ROOT key in subkeys under the CLSID
subkey and in the class description's (Prog ID) subkey.
The Filename Extension Key:
The filename extension entry maps a filename extension to an application identifier. To
register an extension, create a subkey in the HKEY_CLASSES_ROOT key using the three-letter
extension (including a period) and set its value to an application identifier.
<k>HKEY_CLASSES_ROOT</k>
<k>.</k><e>ext</e> = <e>ApplicationIdentifier
</e><idx id=10_RGSTR.DOC-1060>
For the value of the application identifier (also known as programmatic identifier or Prog
ID), use a string that uniquely identifies a given class. This string is used internally
by the system and is not exposed directly to users (unless explicitly exported with a
special registry utility); therefore, you need not localize this entry.
Avoid assigning multiple extensions to the same application identifier. To ensure that
each file type can be distinguished by the user, define each extension such that each has
a unique application identifier. If you have utility files that the user does not interact
with directly, you should still register an extension (and icon) for them, preferably the
same extension so that they can be identified. In addition, mark them with the hidden file
attribute.
The system provides no arbitration for applications that use the same extensions. So
define unique identifiers and check the registry to avoid writing over and replacing
existing extension entries, a practice which may seriously affect the user's existing
files.
More specifically, avoid registering an extension that conflicts or redefines the common
filename extensions used by the system. Examples of these extensions:
386 =Windows virtual device driver
3GR =Screen grabber for MS-DOS-based applications
ACM =Audio compression manager driver
ADF =Administration configuration files
ANI =Animated pointer
AVI =Video clip
AWD =FAX viewer document
AWP =FAX key viewer
AWS =FAX signature viewer
BAK =Backed-up file
BAT =MS-DOS batch file
BFC =Briefcase
BIN =Binary data file
BMP =Picture (Windows bitmap)
CAB =Windows Setup file
CAL =Windows Calendar file
CDA =CD audio track
CFG =Configuration file
CNT =Help contents
COM =MS-DOS - based application
CPD =FAX cover page
CPE =FAX cover page
CPI =International code page
CPL =Control Panel extension
CRD =Windows Cardfile document
CSV =Command-separated data file
CUR =Cursor (pointer)
DAT =System data file
DCX =FAX viewer document
DLL =Application extension (dynamic-link library)
DOC =WordPad document
DOS =MS-DOS file (also extension for NDIS2 net card and protocol drivers)
DRV =Device driver
EXE =Application
FND =Saved search
FON =Font file
FOT =Shortcut to font
GR3 =Windows 3.0 screen grabber
GRP =Program group file
HLP =Help file
HT =HyperTerminalTM file
ICM =ICM profile
ICO =Icon
IDF =MIDI instrument definition
INF =Setup information
INI =Initialization file (configuration settings)
KBD =Keyboard layout
LGO =Windows logo driver
LIB =Static-link library
LNK =Shortcut
LOG =Log file
MCI =MCI command set
MDB =File viewer extension
MID =MIDI sequence
MIF =MIDI instrument file
MMF =Microsoft Mail message file
MMM =Animation
MPD =Mini-port driver
MSG =Microsoft® Exchange mail document
MSN =Microsoft Network home base
NLS =Natural language services driver
PAB =Microsoft Exchange personal address book
PCX =Bitmap picture (PCX format)
PDR =Port driver
PF =ICM profile
PIF =Shortcut to MS-DOS-based application
PPD =PostScriptTM printer description file
PRT =Printer formatted file (result of Print to File option)
PST =Microsoft Exchange personal information store
PWL =Password list
QIC =Backup set for Microsoft Backup
REC =Windows Recorder file
REG =Application registration file
RLE =Picture (RLE format)
RMI =MIDI sequence
RTF =Document (rich-text format)
SCR =Screen saver
SET =File set for Microsoft Backup
SHB =Shortcut into a document
SHS =Scrap
SPD =PostScript printer description file
SWP =Virtual memory storage
SYS =System file
TIF =Picture (TIFFTM format)
TMP =Temporary file
TRN =Translation file
TSP =Windows telephony service provider
TTF =TrueType® font
TXT =Text document
VBX =Microsoft Visual Basic® control file
VER =Version description file
VXD =Virtual device driver
WAV =Sound wave
WPC =WordPad file converter
WRI =Windows Write document
It is a good idea to avoid creating a new extension that might conflict with them, unless
you intend to replace or superset the functionality of those applications.