23 lines
568 B
C
23 lines
568 B
C
#include <windows.h>
|
|
#include <stdio.h>
|
|
|
|
static BOOL CALLBACK enumProc(HWND hwnd, LPARAM lParam)
|
|
{
|
|
wchar_t title[256] = {0};
|
|
GetWindowTextW(hwnd, title, 255);
|
|
wchar_t cls[128] = {0};
|
|
GetClassNameW(hwnd, cls, 127);
|
|
DWORD pid = 0;
|
|
GetWindowThreadProcessId(hwnd, &pid);
|
|
if (IsWindowVisible(hwnd) || title[0])
|
|
wprintf(L"hwnd=%p pid=%lu vis=%d class=%ls title=%ls\n",
|
|
(void *)hwnd, (unsigned long)pid, IsWindowVisible(hwnd), cls, title);
|
|
return TRUE;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
EnumWindows(enumProc, 0);
|
|
return 0;
|
|
}
|