/* * $Id: //devel/tools/main/backstealth/enumwin.cpp#1 $ * * written by: Stephen J. Friedl * Software Consultant * Tustin, California USA * steve@unixwiz.net * * This program enumerates all the system windows and displays * for the user all the titles found (NULL titles ignored). This * lets us identify our firewall process * * To run this: just type "ENUMWIN" and route the output to a file * or to "| MORE". * * It's a very quick hack. */ #include "bscommon.h" #include "bsdefs.h" DWORD nWindows = 0; BOOL CALLBACK EnumWindowProc(HWND hWnd, LPARAM lParam) { UNUSED_PARAMETER(lParam); nWindows++; TCHAR namebuf[1024]; if ( GetWindowText(hWnd, namebuf, ASIZE(namebuf)) > 0 ) _tprintf( _T(" --> {%s}\n"), namebuf); return TRUE; } int __cdecl main(void) { printf("Enumerating windows...\n"); EnumWindows( EnumWindowProc, 0 ); printf("done: total = %d\n", nWindows); return 0; }