C - 如何打开窗口资源管理器

时间:2022-12-15 00:29:14

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.

我正在寻找C语言中的Open window explorer的功能。我找到了这个[答案](如何在WPF应用程序中打开Windows资源管理器到某个目录?),但这是C#语言。 C不能有这些功能吗?我使用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 :)

我是C的初学者。所以我的问题可能看起来非常简单。但如果你给我答案我真的很感激。谢谢 :)

3 个解决方案

#1


2  

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

在资源管理器中打开某个目录的最简单方法(此处为c:\ program files)可能是:

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

#2


2  

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

尝试使用SHOpenFolderAndSelectItems()函数,它可以在Windows资源管理器中打开文件。

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

#3


1  

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.

鉴于stslib.h库包含system()函数,您可以运行shell命令,您应该能够使用您在终端窗口中使用的相同命令运行该命令以打开新的Windows资源管理器窗口。

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

准则:http://www.programmingsimplified.com/c-program-shutdown-computer

#1


2  

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

在资源管理器中打开某个目录的最简单方法(此处为c:\ program files)可能是:

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

#2


2  

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

尝试使用SHOpenFolderAndSelectItems()函数,它可以在Windows资源管理器中打开文件。

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

#3


1  

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.

鉴于stslib.h库包含system()函数,您可以运行shell命令,您应该能够使用您在终端窗口中使用的相同命令运行该命令以打开新的Windows资源管理器窗口。

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

准则:http://www.programmingsimplified.com/c-program-shutdown-computer