Nothing easy. The docs are scattered around the universe, one para here, one
paragraph there.
The official docs, in part, is here. This is very misleading.
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersgu
ide/shell_basics/shell_basics_extending/fileassociations/fileassoc.asp?frame
=true
Each of these can be Per User (usually there are no per user settings) or
per machine. Per user overrides per machine. I'll only list per machine,
just x 2.
File Extension HKCR\.txt
ProgID HKCR\textfile
Classid (most extensions don't have one, but Doc, jpeg etc do)
SystemFileAssociations - extensions
HKEY_CLASSES_ROOT\SystemFileAssociations\.txt
SystemFileAssociations - percieved type
HKEY_CLASSES_ROOT\SystemFileAssociations\text
* (All Files) HKEY_CLASSES_ROOT\*
AllFileSystemObjects HKEY_CLASSES_ROOT\AllFilesystemObjects
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExt
s\.txt (this is Open With and overrides file associations for the default
verb only)
(Umm - That only 16 ther must be more)
So Extensions point to the Progid and the Percieved type, The ProgID points
to the ClSID (if one)
HKCR (HKEY_CLASSES_ROOT) is a merged view of Current User and Local Machine.
As there is usually no CU settings therefore HKCR is HKLM\Software\Classes
which is where the data is stored. Per user associations, if any, are at
HKCU\Software\Classes
The order of execution is Drop Target (only valid on XP or later), DDE
Verbs, Non DDE Verbs, Contect Menus can also affect the verb chosen.
Windows works out what a file is from in this order
The extension
For OLE Compound Files (Word Docs) by the CLSID embedded in the file (why
word docs don't need extensions)
And finally by pattern matching the contents of the file. (EG exe, scr, ocx,
cpl and dll files all start with MZ - the initial of the MS programmer that
designed the Dos exe file format - all windows programs have a dos program
built in, that these days, says "this Program Requires MS Windows if run on
a Dos computer") HKEY_LOCAL_MACHINE\SOFTWARE\Classes\
\FileType
[Note the Com order of finding things is the exact opposite of Explorer's]
You won't find that mentioned in the docs. It's in the Com SDK but appears
to have been removed from the current library (just installed Oct 2001 to
get this key). I've pasted the info below.
Ignore anything in the docs about Private Vs Public. Xp won't have a clue
what you're talking about as this only exists in someones imagination. The
docs leave many (most) small important details out.
You need to read the whole section as it scattered through all the topics.
As to How to use it you need to read The Windows User Experience (it's in
the library). This says what one should do rather than what one can do..
http://msdn.microsoft.com/library/en-us/dnwue/html/welcome.asp?frame=true
(Non-Compound) FileType Key
Used by GetClassFile to match patterns against various file bytes in a
non-compound file.
Registry Entry
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\
\FileType
\<CLSID>
\<n> = <offset, cb, mask, value>
Value Entries
offset
This value determines how far from the beginning or end of the file to
begin the comparison. If the offset is a negative value then the comparison
will begin from the end of the file minus the offset value. The offset value
is a decimal type unless preceded by "0x".
cb
Represents the length in bytes from the beginning to the end of the file.
Represents the byte range in the file. The cb value is a decimal unless
preceded by "0x".
mask
A binary value used for masking, which is performed by using a logical AND
operation, and the byte range specified by offset and cb. If this value is
omitted then the bytes will be set to all ones. This value is always
hexadecimal.
value
Represents the pattern that must match for a file to be of this FileType.
The pattern is used to properly identify a known file format from its
contents not by its extension.
Remarks
Entries under the FileType key are used by the GetClassFile function to
match patterns against various file bytes in a non-compound file. FileType
has CLSID sub keys, each of which has a series of sub keys \0, \1, \2..
These values contain a pattern that, if matched, yield the indicated CLSID.
Following are examples of FileType entries.
\0 = 0, 4, FFFFFFFF, ABCD1234
where the first 4 bytes must be ABCD1234, in that order, or
\1 = 0, 4, FFFFFFFF, 9876543
where they must match 9876543, or
\2 = -4, 4, FEFEFEFE
where the last four bytes in the file must be FEFEFEFE
Peter Wall said:
Thanks. I'll have a look at this. There are several entries under
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers some of which I recognise
immediately, others will need some digging.
Any thoughts as to why this might be affected by the enablement/disablment
of the LAN connection? Unless it's a shell extension that accesses the
network if it's available?
BTW where did you find this information? Any book recommendation?
Thanks again, Peter.
--
Peter Wall
David Candy said:
Hypothsis is an addin is erroring
Type regedit in Start Run
Navigate to
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers (* is all files)
What is under here
If there is not a human readable description look the number up here
HKEY_CLASSES_ROOT\CLSID\<the number>\inprocserver32 [it will be a server
something inprocserver32 is most common]
and look at the file name of the server then View it's version info (by
right clicking it in explorer and choosing Properties).
There is on a standard XP only ContextMenuExtensions and
PropertySheetExtensions with 4 actual extensions of each type. Do you have
more than 4 or do you have other types of extensions listed (newer ones
don't get names just long numbers).
Property Sheets shouldn't cause this. But context menu extensions are run
one by one when you right click a file, they get told what you've
clicked
on
and can choose to add commands to the menu, then the menu gets shown.
* Applies to all files, AllFileSystemObjects applies to all Files and File
Folders. It's possibe that it may be under AllFileSystemObjects but when
it's passed a folder it doesn't crash.
One would expect you Antivirus program to add one. In fact anything under
the first line (as a general rather than absolute rule - in XP the line
sometimes moves down a couple of places) in a context menu is an extension.
Above the line is a verb.
2600.xpsp1.020828-1920