[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

Custom Properties for "virtual folders" in windows explorer

Experts Exchange,

I am developing an application that includes adding a "virtual folder" to the windows explorer tree at the same level as A:\, C:\, D:\, Control Panel etc…., by using the Shell Library Interfaces.

To this "virtual folder" have I attached a context menu handler, and by registering the default flag SFGAO_HASPROPSHEET for this folder, have I managed to enable the "Properties" menu option in the context menu. To this "properties" menu option is my goal to attach custom designed property pages, including a custom first page.

My problem is that when I select the "properties" menu option I get a message from the system telling me that " the needed methods for the object are not available". I have tried to solve the problem with the "IshellPropSheetExt" interface, but as i understand is this interface only for adding extra property pages to standard file property pages.

So, my questions are how do I implement the interface for custom designed property pages, including a custom first page, attached to a "virtual folder" in the windows explorer? As always is there any good sample that shows this mechanism?

I have noticed that in the file Shlguid.h is there Shell Library Interfaces defined but not documented at all. There is for instance an interface ID called "IID_IPropSheetPage". Is it perhaps this interface i should use, and if so where can i find documents that describe this. Is it perhaps interfaces only known by Microsoft?

Best regards

0
StefanJo
Asked:
StefanJo
1 Solution
 
StefanJoAuthor Commented:
Adjusted points to 200
0
 
DmitryCCommented:
Hi,

In case when namespace extension (AKA virtual folder) has got SFGAO_HASPROPSHEET bit set, shell looks for IPropSheetExt CLSID's in the following location:
HKEY_CLASSES_ROOT\CLSID\{your virtual folder CLSID}\ShellEx\PropertySheetHandlers\{your propsheetext CLSID}

It asks to create instance of {your propsheetext CLSID} with IShellExtInit interface. After the Initialize call succeeds it QueryInterfase's it for IPropSheetExt.

Also, try to look at your IContextMenu's InvokeCommand calls. It is possible that shell will call it with "properties" verb and ask to display PropertySheet dialog by yourself.

My extension is rooted from Desktop and I tried to put it into My Computer (as you did) also - it works fine.

Regards,
Dima
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now