How to use Shell32 within a C# application?

后端 未结 9 1682
野的像风
野的像风 2020-11-27 17:21

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

Edit:

My application can\'t recognize shell32. What references

相关标签:
9条回答
  • 2020-11-27 18:04

    Referencing the actual shell32.dll is deprecated. You will get errors in .NET Framework 4+. Using an older .NET Framework just to use the shell32.dll limits your program's capabilities. In applications for windows 7+ and .NET Framework 4+ you should always use the .COM component instead. Right click project. Click Add reference. Click .COM tab in Add reference dialogue. Select Microso.ft Shell Controls and Automation. Click OK

    0 讨论(0)
  • 2020-11-27 18:12

    I'm guessing that you're having trouble getting any calls recognized, so I'd refer you to this general article: http://www.codeproject.com/KB/shell/csdoesshell1.aspx

    Beyond that, you'll need to provide specifics of what isn't working for you.

    0 讨论(0)
  • 2020-11-27 18:18

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

    Shell32.Shell shell = new Shell32.Shell();
    shell.MinimizeAll();
    
    0 讨论(0)
提交回复
热议问题