実行ファイルのPATHは、GetModuleFileName()関数で取得可能です。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #include <tchar.h> #include <iostream> #include "windows.h" /* 実行ファイルのPATHを取得する */ int _tmain ( int argc , _TCHAR* argv[] ) { TCHAR waFilePath[ MAX_PATH ]; // 実行ファイルのPATH名を得る ::GetModuleFileName( NULL, waFilePath, MAX_PATH ); // 取得したパスを出力 std::wcout << waFilePath << std::endl; } |
c:\OrgApps\Fav\WabisabiSampleSource\Tools\test\AppTest.exe