// EnumWindows(WndEnumProc, 0); BOOL CALLBACK WndEnumProc(HWND win, LPARAM lparam) { LPWSTR buffer = (LPWSTR) malloc(1025 * sizeof(LPCWCHAR)); LPWSTR title = (LPWSTR) malloc(1025 * sizeof(LPCWCHAR)); GetWindowText(win, title, 1024); GetClassName(win, buffer, 1024); wprintf(L"Window: '%s' Class: '%s'\n", (wchar_t*)title, (wchar_t*)buffer); free(buffer); free(title); return true; }