Thank you David, I wish there was more people like you in
this world. =)
-----Original Message-----
If I understand this correctly (and windows uses this if
it doesn't recognise the extension as well -
HKEY_CLASSES_ROOT\FileType key contain pattern matching
data) you can't do this for most text files.
It relies on there being a fixed pattern of bytes, with
one exception, a text file is exactly what it looks like
in notepad. If every text document started with the
word "The" you could match this - but text files tend to
have different text in them (obviously). A exe, dll, ocx
all start with MZ (the initials of the programmer that
developed the Dos exe format - all windows executables
include a dos program before the windows program in the
file - run a win prog in Dos - the message comes from the
Dos part of the program not from the OS) so you can match
to that.
The one exception is unicode text files which start with
a 2 byte header that specifies the language of the file.
You could pattern match on that. For me it's 255,254
character codes (use edit to view the text file in binary
mode edit /70 filename.txt to see - bottom right corner
for the code). Unicode specs are here
http://www.unicode.org/. Windows XP makes unicode files
by default but works seemlessly with either.