// ProcessGetCurrentProcess.cpp : メイン プロジェクト ファイルです。 #include "stdafx.h" using namespace System; using namespace System::Diagnostics; int main(array ^args) { // 現在のプロセスを取得する Process^ hProcess = Process::GetCurrentProcess(); // プロセス名を表示する Console::WriteLine(hProcess->ProcessName); // 不要になった時点で破棄する hProcess->Close(); // hProcess->Dispose(); return 0; }