tags:

views:

65

answers:

1

I'm trying to write a shell extension using C# however I haven't found any example on the web about how to use SHCreateShellFolderView windows API function. Does anyone has some example of how to use it?

I'm trouble to use it on Windows 7.

+1  A: 

My suggestion is to take a look at codeproject C# does Shell, Part 1 and Namespace Extensions: The Tasks Band Disclosed. First article introduces shell programming with C#, and second one is about how to use SHCreateShellFolderView with unmanaged C++.

volody
Do you have a C# specific example?
Carlos Loth
No I don't. It looks like Microsoft recommends against writing managed shell extensions and does not consider them a supported scenario http://msdn.microsoft.com/en-ca/magazine/cc188741.aspx. But anyway is possible to create unmanaged component for that and access it with managed wrapper.
volody
I was aware of this recommendation, but it was stated before the CLR v4.0. On CLR v4.0 there is a feature called in process side-by-side execution which make it possible for a process to load more than one version of the CLR at the time. So, if you write your extension using C# 4.0 there is no problem.
Carlos Loth
I don't know if that will help you, but just have picked first googled item by using "SHCreateShellFolderView DllImport" as key http://us.generation-nt.com/question-about-shcreateshellfolderview-drag-drop-drop-nse-fine-but-drag-nse-dropsource-problem-help-25808062.html
volody