yy981 ファイルシステムユーティリティ用名前空間
[詳解]
|
| std::string | resolveShortcut (const std::string &lnkPath) |
| | Windows ショートカット (.lnk) ファイルのリンク先パスを解決する
|
| int | start (const std::string app, std::string arg="", const bool wait=false, const std::string &cd="") |
| | アプリケーションを起動する(.lnk ショートカット対応)
|
yy981 ファイルシステムユーティリティ用名前空間
◆ resolveShortcut()
| std::string yfs::resolveShortcut |
( |
const std::string & | lnkPath | ) |
|
Windows ショートカット (.lnk) ファイルのリンク先パスを解決する
- 引数
-
| lnkPath | 解決する .lnk ファイルのパス(std::string) |
- 戻り値
- リンク先の実ファイルパス文字列
- 例外
-
| std::runtime_error | .lnk の解決に失敗した場合 |
- 覚え書き
- COM (CoInitialize/CoUninitialize) を内部で初期化・解放します
fs.h の 30 行目に定義があります。
◆ start()
| int yfs::start |
( |
const std::string | app, |
|
|
std::string | arg = "", |
|
|
const bool | wait = false, |
|
|
const std::string & | cd = "" ) |
アプリケーションを起動する(.lnk ショートカット対応)
- 引数
-
| app | 起動するアプリケーションのパス。.lnk 拡張子の場合は自動的にリンク先を解決します |
| arg | コマンドライン引数(デフォルト: 空文字列) |
| wait | プロセスの終了を待つか(デフォルト: false) |
| cd | 起動時のカレントディレクトリ(デフォルト: 空文字列 = 親プロセスと同じ) |
- 戻り値
- wait=true の場合は起動したプロセスの終了コード、wait=false の場合は 0
- 例外
-
| std::runtime_error | 起動失敗または .lnk 解決失敗時 |
fs.h の 69 行目に定義があります。