Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Whenever the Shell needs to query for file association attributes for a file type, it creates an array of registry keys. The Shell checks the following registry keys, in order of decreasing priority.
PerceivedTypes are similar to file types except they refer to broad categories of file format types, rather than specific file types. For example, Image, Text, Audio, and Compressed are PerceivedTypes. File types (generally public file types) can also have a PerceivedType, and should always be defined as such when appropriate. For example, the image file types .bmp, .png, .jpg and .gif are also of PerceivedType Image.
The system defines several PerceivedTypes in Microsoft Windows XP. These include the following:
The SystemFileAssociations key under HKEY_CLASSES_ROOT stores PerceivedTypes. For example, the PerceivedType text appears as follows:
HKEY_CLASSES_ROOT
SystemFileAssociations
text
shell
edit
open
A file type's perceived type is indicated by including a PerceivedType registry string in the file type's key and specifying the perceived type. For example, to include .cpp files as PerceivedType text, you enter the following:
HKEY_CLASSES_ROOT
The SystemFileAssociations keys exist to guarantee that Shell extensions are installed regardless of the current default ProgID or user customization. These keys enable Windows XP to define fallback attributes for file types and enable shared file associations. Supplemental verbs should be added under SystemFileAssociations .
When the ShellExecute function is provided with the name of an executable file in its lpFile parameter, there are several places that it can look in an attempt to find the file, including the following:
The order that those locations are searched varies, though the App Paths key is preferred in Windows XP Service Pack 1 (SP1). The keys found under App Paths are used primarily for the following two purposes.
To provide this functionality for your application, add a subkey with the same name as your executable file to the App Paths key as follows:
HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
Windows
CurrentVersion
App Paths
Note The file name can be provided without its .exe extension. The ShellExecute function adds the extension if necessary when searching App Paths .
If a key matching the file name is found, the Shell can perform two actions. First, the (Default) value can be used as the file's fully-qualified path. Second, the Path value for that key can be appended to the end of that process' PATH environment variable. If that functionality is not required, the Path value can be omitted.
DropTarget is a REG_SZ value containing the class identifier (CLSID) of an object—usually a local rather than in-process server—that implements IDropTarget. By default, when the target is an executable file, the Shell converts the list of dropped files into a command line parameter passed to ShellExecute in its lpParameters parameter. There are several potential issues that can arise from this.
Using the DropTarget value avoids these issues by giving access to all of the clipboard formats, including CFSTR_SHELLIDLIST (for long file lists) and CFSTR_FILECONTENTS (for non-file system objects).
In addition to the three values recognized by the Shell, an application can also add custom values to its key to use as needed.
Applications are encouraged to use the App Paths key to provide an application-specific path rather than adding to the global system path.
Please sign in to use this experience.
Sign in