C - How can open window explorer

☆樱花仙子☆ 提交于 2020-01-06 19:03:33

问题


I'm looking for function that Open window explorer in C language. I have found this [answer](How can I open Windows Explorer to a certain directory from within a WPF app?), but this is C# language. C can't have these features? I use VS 2010.

I'm a beginner of C. So my question may seem ridiculously easy. But if you give me the answer I really appreciate it. Thanks :)


回答1:


The simplest way to open a certain directory in an explorer (here c:\program files) may be:

system("start \"\" \"c:\\program files\"");



回答2:


Try using SHOpenFolderAndSelectItems() function, which can open files in windows explorer.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762232(v=vs.85).aspx




回答3:


Given the stslib.h library contains the system() function that let's you run shell commands, you should be able to run the command to open a new windows explorer window using the same command you would use in the terminal window.

A guideline: http://www.programmingsimplified.com/c-program-shutdown-computer



来源:https://stackoverflow.com/questions/29226198/c-how-can-open-window-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!