3

First, sorry for my poor English...

I want to add a virtual folder to Windows Explorer using a Namespace Extension (NSE), and I want users to be able to open this virtual folder to explore some path (e.g., c:\test).

How can I do this using Delphi? Thanks.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
dropme
  • 31
  • 2

3 Answers3

7

The place to start is the MSDN documentation: Introduction to the Shell Namespace. Naturally this is written from a C++ perspective but it's not too hard to map that across to Delphi.

Another excellent resource for such tasks is Code Project. For example: The Complete Idiot's Guide to Writing Namespace Extensions - Part I by Mike Dunn. In fact this is just part of an excellent series of articles on shell extensions.

At present Delphi is a poor choice because it does not produce 64 bit executables. This means that your shell extension will not run on 64 bit Windows which is now a serious limitation.

With the recent release of Delphi XE2 this limitation has been removed. XE2 is capable of producing 64 bit executables and can therefore be used to produce 64 bit shell extensions.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • thx, and i just want to learn namespace extension, so i don't care this~ – dropme Dec 13 '10 at 07:46
  • 1
    @dropme in that case Delphi is a fine choice because the VCL COM code wraps up a lot of the complexities and allows you to concentrate on the real issues; but if you ever had to deploy a shell extension widely then my point stands – David Heffernan Dec 13 '10 at 09:13
  • 4
    +1, this is ONE of the places where not having an x64 version of the Delphi Compiler is a serious limitation. – Remko Dec 13 '10 at 09:54
  • I think it does answer the question, by pointing it out that it can't be done without a serious limitation. – stg Dec 15 '10 at 00:25
  • Time for this answer to be deleted. Delphi XE2 does not support 64 bit compilation. – mj2008 Nov 17 '11 at 16:05
  • @mj2008: How do you figure that? XE2 **does** compile 64-bit applications. – Ken White Nov 17 '11 at 17:00
  • @Ken The answer is badly worded. Putting in an update that corrects the first para is not a good solution. It should refocus or be removed (or replaced). Note that it has 3 downvotes at present (not mine FWIW). – mj2008 Nov 17 '11 at 18:34
  • @mj2008: No, my question was for **you** based on your last comment. I quote "Delphi XE2 does not support 64 bit compilation". In fact, it **does**. I'm running an XE2 64-bit app right this second on my Windows 7 Professional 64-bit machine. – Ken White Nov 17 '11 at 18:36
  • 2
    @mj2008 I have a written a huge number of answers here. Am I expected to go over all historical answers to keep them up to date? If you feel strongly about this you are very welcome to make the changes you feel are needed yourself. – David Heffernan Nov 17 '11 at 18:50
  • @David This Q came up in my RSS feed again for some reason. But I can edit, not delete a response. I figured that deleting was the best option, hence my original comment. If you cannot or don't want to, I'll happily edit. – mj2008 Nov 17 '11 at 20:46
  • @mj2008 OK, I hope the latest update meets with your approval!! – David Heffernan Nov 17 '11 at 20:53
  • @mj2008 Thanks for prompting me to improve this. It's better now. Sorry for being a bit stroppy before. – David Heffernan Nov 17 '11 at 21:12
3

Basically a shell extension is a COM object that implements a set of interfaces. Which interfaces needs to be implemented depends on the type of the extension (there are some used by any extension, of course). You can start reading here (you need some C -> Delphi translation, but when you start to work on such matters is better you get prepared to it), and then the reference is of course MSDN

2

http://www.shellplus.com/examples/namespace-extension-example.html
http://delphipower.tripod.com/winshell.htm

RBA
  • 12,337
  • 16
  • 79
  • 126
  • thx, i'm learning namespace extension,so i care about HOW, i don't want to use 3rd party components~ i can't explore http://delphipower.tripod.com/winshell.htm—— 404 Error – dropme Dec 13 '10 at 07:48