How to use Shell32 within a C# application?

Lisa picture Lisa · Apr 18, 2011 · Viewed 71k times · Source

What should I include within a C# application in order to make Shell32 work?

Edit:

My application can't recognize shell32. What references or lib should I include? What I'm trying to do is:

Shell32.Shell shell = new Shell32.Shell(); 

What I'm getting as an error:

Error 1 The type or namespace name 'Shell32' could not be found (are you missing a using directive or an assembly reference?)

Answer

Vasiliy Ermolovich picture Vasiliy Ermolovich · Apr 18, 2011

Just add a reference to Shell32.dll from the Windows\System32 folder and use it:

Shell32.Shell shell = new Shell32.Shell();
shell.MinimizeAll();