Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IShellFolder::GetDisplayNameOf

0 views
Skip to first unread message

jsch...@one.net

unread,
Sep 13, 1996, 3:00:00 AM9/13/96
to

I have a program (written with Borland C++ 5.0) that utilizes the
TShellItem object for doing Win95 stuff (iterating through folders,
etc.) My app looks like Explorer with a treeview of drives and dirs
and a listview of files. It displays thumbnail images of graphics
files in the listview. Someone was beta testing and ran into a
problem which I had not encountered. They weren't seeing any images
when they switched to a directory that had graphic files in it. Yet,
I had never had any problems.

However, I discovered what the problem was and it seems to be rather
strange and I was hoping someone could shed some light on it. If, in
Explorer, you select Hide MS-DOS extensions of registered file types,
IShellFolder::GetDisplayNameOf(SHGNO_NORMAL) returns the file name
without the extension. I was trying to open this file but since I had
no extension, I couldn't find the file. If that option is not turned
on, it returns the name with the extension.

I got around the problem by using SHGNO_FORPARSING (whatever it's
called) and then parsing the name out.

I thought this was very strange that an option in Explorer would
affect an API call like IShellFolder::GetDisplayNameOf.

Anyone have any ideas why MS would do something like this?

Jonathan Schafer


Raymond Chen

unread,
Sep 13, 1996, 3:00:00 AM9/13/96
to

GetDisplayNameOf means what it says. Get the *display* name.

The "display name" of an item is "The name you should display to
the user". Programs are explicitly warned *not* to use the
display name for any other purpose. Specifically, it is not
necessarily a valid file name.

That's what "for parsing" is for. "For parsing" means "A program
is going to analyze (parse) the return value, so put it into a
form that uniquely identifies the item".
--
(Note that my return address is intentionally invalid in order
to foil electronic mailing list generation software.)

0 new messages