When is HTML not HTML?


So i was looking at a folder on my disk and i was quite suprised to see the following:



            



Two html files with different icons.  I thought maybe i had a
extensions turned off and these were actually epl-v10.html.wordhtml or
something weird like that.  So i took a look at at the files at
the command prompt and i saw this:



            



so that eliminated that idea.



So i start hunting around inside the file and after bit of playing
around i discovered that the adding and removing the following lines
would change the icon that was displayed:



    <meta name=ProgId content=Word.Document>

    <meta name=Generator content=”Microsoft Word 9″>

    <meta name=Originator content=”Microsoft Word 9″>



Very interesting.  I always thought that icon selection was
independent of the contents in the file, but now i guess that that’s
not the case.  Neat!



So does this mean i can see picture thumbnails when i’m in “Icon” mode and not “Thumbnail” view?


Comments (15)

  1. Office applications register themselves as "icon handlers" with the Windows shell, and need to actually open and read the file to figure out if they created it to display a different icon.

    Regardless to say, since I installed Office 2003 I find myself constantly annoyed at the speed with which directories with thousands of XML files display in Explorer. Especially over the network. FrontPage and Word and everyone else needs to look at it before I get a flippin’ icon.

    Like the ZIP support in WinXP, this is one "feature" that MSFT didn’t really think through very well.

  2. Yaytay says:

    That’s not ‘Neat!’ at all, it’s a hideous waste of time and resources.

    What happens if the file cannot be opened?

    So the icon is no longer based on the file, it’s based on a whole pile of stuff relating to the machine, the user, the file system…

    Nearly all of the explorer extensions seem designed to obfuscate and complicate the file system.

    Not impressed.

    A garden fork is a garden fork.

  3. Alex says:

    So does this mean i can see picture thumbnails when i’m in "Icon" mode and not "Thumbnail" view?

    You’ve been able to do that since Windows 95 – simply edit the icon entry in the registry (within Classes) so that instead of pointing to an Ico file (or more likely a file within an dll) it points to %1 – though this doesn’t work for all file formats and there is a reason for using thumbnail view – thumbnails are cached instead needing reloading each time and are actually at a size where they are viewable.

  4. CyrusN says:

    Yatay: "That’s not ‘Neat!’ at all, it’s a hideous waste of time and resources."

    I have an enormous amount of free CPU cycles and memory. I have no prolem with them being used.

    "What happens if the file cannot be opened?"

    Presumably it would fall back to the extension.

    "So the icon is no longer based on the file, it’s based on a whole pile of stuff relating to the machine, the user, the file system… "

    Yup! Isn’t that awesome! Now we can have strong visual indications when looking at the files!

    "Nearly all of the explorer extensions seem designed to obfuscate and complicate the file system. "

    Sure. But the intent is to make things easier for the user. That’s definitely what i want to see my computer’s power going to work for.

  5. CyrusN says:

    Alex: "and are actually at a size where they are viewable. "

    In picasa i have the thumbnail size set to the smallest. That’s the same size as the icon view in explorer. So it’s perfect for me.

    That it’s not cached would be a problem though 🙁

  6. Tim says:

    When I’m loading up a directory in Explorer I generally have a stack of CPU and mem free as well, but what I’m fantastically short of at that point is HDD performance (or even worse, network bandwidth)… the same subsystems that get flogged having to load the contents of the file…

  7. Visual Studio 2005 appears to do that, too. If you’ve got a .SLN file, it’ll have a little 7 or a little 8 in the icon, depending on whether it’s a VS2003 or VS2005 solution…

  8. Alex says:

    "In picasa i have the thumbnail size set to the smallest. That’s the same size as the icon view in explorer. So it’s perfect for me. "

    Well if you really like tiny thumbs you can always alter the size of the thumbnails generated by explorer – I actually make mine bigger but there’s no reason why you can’t make them smaller – thinking about it maybe TweakUI has a GUI for that setting – a quick google will find you the reg key anyway.

  9. Haacked says:

    It may be hideous for slow moving computers, but it serves a very useful purpose. In general that would indicate that the HTML was saved from word and can be round tripped back to word without loss of formatting.

    If you view source, do you see a LOT of funky html with things like:

    <o:p>

    etc…

    p.s. Cyrus, what happened to the CommentAPI interface to post comments to your blog?

  10. Paul says:

    So where’s the option to turn it off?

  11. Orion Adrian says:

    Something I’d like to see instead of this is icons for a file based on the purpose of that file and not the extension or contents. For example image documents come in many forms… I could have photograph, art, composition, background, icon, etc. This to me is a lot more helpful than .jpg, .png, .gif, .bmp.

    I think people need to start looking past extensions and file types and start looking more towards function and purpose.

    Orion Adrian

  12. gerrard says:

    This is also what let’s InfoPath do it’s magic, since it’s files are always .xml files.