#include #include int main() { char path[MAX_PATH]; // アプリケーションの実行ファイルのパスを取得 DWORD length = GetModuleFileNameA(NULL, path, MAX_PATH); if (length == 0) { // エラー処理 fprintf(stderr, "Failed to get the executable path. Error code: %lu\n", GetLastError()); return 1; } // 取得したパスを表示 printf("Executable Path: %s\n", path); return 0; }