LoginSignup
3
4

More than 3 years have passed since last update.

2015-10-11 c++ builder XE4, 10.2 Tokyo > エクスプローラを開いてファイル選択状態にする > ShellExecute(NULL, NULL, L"explorer.exe", L"/select,C:\\WINDOWS\\explorer.exe", NULL, SW_SHOWNORMAL);

Last updated at Posted at 2015-10-11
動作確認
C++ Builder XE4
Rad Studio 10.2 Tokyo Update 2 (追記: 2017/12/27)

フォルダをエクスプローラで開くコードを探していて、タイトルのコードを偶然見つけた。
SO

/select,とファイル名でいいとのこと。

    ShellExecute(NULL, NULL, L"explorer.exe", L"/select,C:\\WINDOWS\\explorer.exe", NULL, SW_SHOWNORMAL);

explorer.png

.cppファイル指定時の動作

(2019-05-30追記)

上記はexplorer.exeを対象としたが、.cppファイルを対象とした場合は、エディタが.cppファイルを開くようになった。

Windows 10 v1809上。秀丸エディタを使用。

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4