TIP 432: Support for New Windows File Dialogs in Vista and Later

Author:		Ashok P. Nadkarni <[email protected]>
State:		Final
Type:		Project
Vote:		Done
Created:	20-Sep-2014
Tcl-Version:	8.6.3
Tk-Branch:	apn-win-filedialogs


This TIP proposes changing the tk_getOpenFile, tk_getSaveFile and tk_chooseDirectory dialog box commands to display the new style file dialogs available on newer Windows versions.


As of Tk 8.6.2, the above commands translate to Windows native file dialogs corresponding to the ones present in Windows XP (the earliest version of Windows supported by Tcl 8.6). Vista and later Windows systems have newer versions of these dialogs with additional features and a different look and feel. Although the older dialogs are functional on these platforms, they have the following issues:

In addition, this TIP proposes some changes to behaviour with respect to existing dialogs that would make the dialogs more consistent with Windows conventions.

Proposed Changes

The proposal will result in the tk_getOpenFile, tk_getSaveFile and tk_chooseDirectory dialog box commands displaying the new Vista style file dialogs if available and falling back to the older style otherwise. Options to the commands and return value from the dialogs remain unchanged except as noted below.

Incompatible changes

If the -initialdir option is not specified, the new dialog will default to the default Windows mechanism for choosing the initial directory displayed. Documentation will be updated to state that the initial directory displayed when this option is not present is system dependent.

Reference Implementation

A reference implementation is available in the apn-win-filedialogs branch.

The new dialogs require a new COM interface IFileDialog. The reference implementation uses this interface if available and falls back to the old one otherwise.



This document has been placed in the public domain.