INFO: Purpose and Format of Folder.htt

サポートが終了した KB の内容についての免責事項

この記事は、マイクロソフトがサポートを提供しなくなった製品について記述しています。 したがって、この記事は「現状のまま」で提供され、更新されることはありません。


Folder.htt is a HyperText Template file containing HTML code that individually or globally customizes the display of folder contents when Internet Explorer 4.0x (IE) is installed. The default Folder.htt file contains script to access and display information from the FileList control, examples of how to handle folder window resizing, and how to use the Thumbnail Viewer control.

More Information

The default Folder.htt file is stored with the Hidden attribute under the Web subdirectory of the Windows directory (that is, C:\Winnt\Web or C:\Windows\Web). In an open folder, when you right-click to bring up the shortcut menu and "Customize this Folder..." is selected, a dialog box appears. In this dialog box, "Create or edit an HTML document" may be selected.

If this is the first time you have customized this folder, clicking the Next button causes the customization wizard to copy Folder.htt from the location listed above to the current folder. If this is not the first time you have customized this folder, the customization wizard will use the existing Folder.htt in the current folder. The wizard then allows you to edit this file. Another file, Desktop.ini, is also created in the directory and is used by the shell to locate Folder.htt.

By default the folder customization wizard invokes notepad to edit Folder.htt, but the .htt extension may be associated with any suitable HTML editor. Microsoft FrontPage is a popular choice.

The general layout of the HTML in the default Folder.htt file is as follows:

Style settings:

Defined for use throughout the file.

FixSize function:

JavaScript handles panel resizing. If the window that is used to view this folder is too small, this routine hides the banner and attributes panels.

FormatNumber function:

JavaScript that returns the comma-delimited form of a number.

Init function:

JavaScript dispatch routine used to initialize the display.

SelectionChanged event:

JavaScript that is called when the selection changes in the FileList control. The script retrieves file attributes, calculates various values, positions items, and creates an output string that displays the information using the innerHTML property.

OnThumbnailReady event:

JavaScript called when a thumbnail has been generated for the selected item.

Normal Banner DIV:

Banner displayed when the folder view window is large enough.

Mini-banner DIV:

Banner displayed when the folder view window is too small.

Left Info Panel DIV:

Panel that displays the folder and the selected item attributes, including the thumbnail view. Also includes a commented out section where custom HREF's may be added easily.

FileList object tag:

Instantiation of the FileList control used primarily in the SelectionChanged event script above.

The FileList control is a ShellFolderView object and is documented in the Microsoft Developer Network (MSDN):

Please note that the ShellFolderView object is only valid inside a Folder.htt file. The ShellFolderView object cannot be used anywhere else (for example, in a Visual Basic program or a Web page), because the object is self-initializing and there is no way to get it to navigate to a folder.

While the folder view provided by the default Folder.htt is perhaps the most intuitive, it is not the only display available. The contents of Folder.htt are fully customizable and can provide any of the functionality that a normal Web page provides.

文書番号:181689 - 最終更新日: 2012/09/20 - リビジョン: 1