#include #include int main() { // 自分自身のプロセスハンドルの取得 HANDLE hProcess = GetCurrentProcess(); // 終了コードの格納用変数の初期化 DWORD exitCode = 0; // 終了コードの取得 if (!GetExitCodeProcess(hProcess, &exitCode)) { // エラー処理 return 1; } // 終了コードの表示 printf("Exit Code: %d\n", exitCode); // プログラム終了 return 0; }