原文链接: http://futurecode.is-programmer.com/posts/24780.html

假设在C:\目录下存在文件a.txt。

打开这个目录是ShellExecute的常用功能,代码如下:

ShellExecute(NULL, "open", "explorer.exe", "C:\\", NULL, SW_SHOWNORMAL);

要在此基础上增加“选中文件”功能(这是很多下载工具和格式转换工具提供的常用功能),只需要将上面目录的名称换成文件的名称,并在前面加上"/select,":

ShellExecute(NULL, "open", "explorer.exe", "/select,C:\\a.txt", NULL, SW_SHOWNORMAL);

 

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
  • 2021-09-15
猜你喜欢
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-10-16
  • 2021-12-05
相关资源
相似解决方案