How To Determine if File Extension Should Be Shown for a File (179364)
The information in this article applies to:
- Microsoft Win32 Application Programming Interface (API)
This article was previously published under Q179364 SUMMARY
Windows 95 and Windows NT do not provide any way to determine if a user has
globally turned off the display of file extensions in Windows Explorer. To
find out if an extension should be displayed on a file-by-file basis, you
can use the APIs GetFileTitle() or SHGetFileInfo() to get the proper
display name of a file. In either case, the API will give the title of the
file properly formatted for display. If the user has requested that file
extensions be displayed for that file type, then it will have an extension.
Otherwise, it will not.
NOTE: If you have Internet Explorer 4.0 or greater installed, you can use
the SHGetSettings API to determine if the user has specified that file
extensions be displayed. However, if your application is displaying file
names, you should use the method outlined in this article to get the proper
display name for a file.
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbhowto KB179364 |
---|
|