#include #include int main() { // メインウィンドウのハンドルを取得する HWND hwnd = GetForegroundWindow(); // ウィンドウのタイトルを格納するためのバッファを作成する char title[256]; // タイトルを取得する GetWindowTextA(hwnd, title, sizeof(title)); // タイトルを出力する printf("Window Title: %s\n", title); return 0; }