views:

334

answers:

2

I have created a namespace extension that is rooted under Desktop. The main purpose of the extension is to provide a virtual list of ZIP files that represent a list of configurable directories. When the user clicks one of the those items the contents of the related directory are zipped in place and the resulting ZIP file is stored in a cache folder.

All this works well aside a minor issue. If we go to Windows Explorer, open the extension and double click an item the opened file is the one from the cache. [CORRECT]

If on the other hand we open it by an Open Dialog the opened file is one from a Temporary Internet files directory. [INCORRECT]

What do I have to change for the Open Dialog (when used for example trough notepad.exe) to open the file from the cache folder and not from Temporary Internet files. I have tried to send allways the qualified file name in IShellFolder::GetDisplayNameOf but without any luck.

A: 

It sounds like you are not passing in the correct initial directory (in the lpstrInitialDir or lpstrFile parameter of your OPENFILENAME struct).

Enter your cache directory in lpstrInitialDir and leave lpstrFile blank and it should work.

gbjbaanb
I dont get to open the file directly. This is being taken care by the Shell programming model given the name provided in IShellFolder::GetDisplayNameOf.
smink
A: 

The problem was fixed by masking SFGAO_FILESYSTEM in the attributes returned by implementation of interface method IShellFolder::GetAttributesOf.

smink