PDA

View Full Version : What does each bit of the Attribute value mean?



Anonymous
11-17-1999, 05:30 AM
Hi,
I'm writing a utility in VB to manipulate the windows95 registry keys. When I try to use the API call REGQUERYVALUEEX to read the value DEFAULT under the registry key
HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}
the function returns an error code 2. Is this due to the attributes assigned to these special folders? If so, How can I modify the value ATTRIBUTE under the key
HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ShellFolder
so that the API function can read the data? And what does each bit location of the ATTRIBUTE value mean?
Thanx
SOS

jstolz
11-18-1999, 02:17 AM
I'm not sure where to find the meaning of errorlevel codes generated by such API calls... try the URL listed below. Meanwhile, the following is a lengthy treatise on both the "Editflags" and "Attributes" values:

Regards...
----------------------------------------
There are quite a few entries in the registry that pertain to context menus. In general, context menu commands for a specific file type are listed in "HKEY_ROOT_CLASSES\FILE.TYPE." A file object can add commands to the context menu to handle which applications edit, open, and print a particular file object. Developers usually add these commands under the "HKEY_ROOT_CLASSES\FILE.TYPE\SHELL" key.

The "HKEY_ROOT_CLASSES\FILE.TYPE\SHELLEX" key also contains commands that will appear on the context menu. Under the "HKEY_ROOT_CLASSES\FILE.TYPE\shellex\ContextMenuHan dlers" key, context menu handlers that are implemented by a separate class are listed. In addition to context menu handlers, other types of handlers are listed under this key. Other types of handlers and the descriptions can be found at

http://msdn.microsoft.com/library/sdkdoc/shellcc/shell/ShellExt.htm.

If you wish to have shell extensions or context menu commands available to all file types, list them under "HKEY_ROOT_CLASSES\*" key. The EditFlags
value is used to disable certain commands in the Edit File Type dialog box and the File Types property page. These dialog boxes are listed under the View menu under options. This flag is typically used to restrict a user from modifying a registered file type. Below is a list of the restrictions that can be added:

Byte Bit BinaryValue of Byte Hex Value of Byte
1 1 0000 0001 01 00 00 00 Hide the description in the Registered File Types list.
1 2 0000 0010 02 00 00 00 Adds file type to "File Types" list if it isn't an actual file.
1 3 0000 0100 04 00 00 00 Identifies a type with no associated extension.
1 4 0000 1000 08 00 00 00 Disable the Edit button on the File Types property page.
1 5 0001 0000 10 00 00 00 Disable the Remove button on the File Types property page.
1 6 0010 0000 20 00 00 00 Disable the New button in Edit File Type dialog box.
1 7 0100 0000 40 00 00 00 Disable the Edit button in the Edit File Type dialog box.
1 8 1000 0000 80 00 00 00 Disable the Remove button in the Edit File Type dialog box.
2 1 0000 0001 00 01 00 00 Disable the Description Of Type edit box in the Edit File Type dialog box.
2 2 0000 0010 00 02 00 00 Disable the Change Icon button in the Edit File Type dialog box
2 3 0000 0100 00 04 00 00 Disable the Set Default button in the Edit File Type dialog box
2 4 0000 1000 00 08 00 00 Disable the actions description.
2 5 0001 0000 00 10 00 00 Disable the command line of action.
2 6 0010 0000 00 20 00 00 Disable the DDE settings.

Note 1. The last 2 bytes are always 0
2. In order to combine several restrictions into one entry, add in binary with bitwise OR. E.G. to restrict the remove and edit buttons:
0000 1000 08 hex
0001 0000 10 hex
0001 1000 18 hex = result

Context Menu options can also be configured under the "HKEY_ROOT_CLASSES\CLSID\CLSID#\ShellFolder\Attribu tes" key.

Byte Bit BinaryValue of Byte Hex Value of Byte
1 1 0000 0001 01 00 00 00 Add the Copy Command
1 2 0000 0010 02 00 00 00 Add the Cut Command
1 3 0000 0100 04 00 00 00 ?
1 4 0000 1000 08 00 00 00 ?
1 5 0001 0000 10 00 00 00 Add the Rename Command
1 6 0010 0000 20 00 00 00 Add the Delete Command
1 7 0100 0000 40 00 00 00 Enable the Properties
2 1 0000 0001 00 01 00 00 Add the Paste Command
3 1 0000 0001 00 00 01 00 Place shortcut overlay (LINK)
3 2 0000 0010 00 00 02 00 Used by multiple users (SHARE)
3 3 0000 0100 00 00 04 00 (READONLY)
3 4 0000 1000 00 00 08 00 Can't be selected (GHOSTED)
4 2 0000 0010 00 00 00 20 Add Commands From the "HKEY_ROOT_CLASSES\Folder\Shell" key

Just like above, these flags can be combined into one entry using the same procedure. **Note: Some flags are not available for all objects.