EnumWindowsProcの実装例
BOOL CALLBACK myEnumWindowsProc(
HWND hwnd, // 親ウィンドウのハンドル
LPARAM lParam // アプリケーション定義の値
) {
TCHAR buf[1024];
TCHAR className[1024];
TCHAR title[1024];
ZeroMemory(className, sizeof className);
ZeroMemory(buf, sizeof buf);
ZeroMemory(title, sizeof title);
GetClassName(hwnd, className, sizeof className); // クラス名
GetWindowText(hwnd, title, sizeof title); // タイトル
wsprintf(buf, _T("%d: %s: %s\n"), hwnd, className, title);
OutputDebugString(buf);
return TRUE;
}