//Get all windows..non visible also
#include <windows.h> #include <stdio.h>
HWND hWnds[16365]; DWORD hWndsNo = 0;
BOOL CALLBACK EnumWinsProc(HWND hWnd, LPARAM lParam) { hWnds[hWndsNo++] = hWnd; return(TRUE); }
int main() { char str[256]; EnumWindows(EnumWinsProc, NULL); for (DWORD i = 0; i < hWndsNo; i++) { GetWindowText(hWnds[i], str, 255); printf("%s\r\n", str); } printf("\r\nThere are currently %d windows...", hWndsNo); return 0; } |