|
BOOL CALLBACK EnumWindowsProc( HWND hWnd, LPARAM lParam )
{
char buffer[512];
DWORD ProcessId;
HWND hList;
int nRow;
if ( IsWindowVisible( hWnd ) ) {
hList = (HWND)lParam;
nRow = ListView_AddRow( hList );
wsprintf( buffer, "%ld", hWnd );
ListView_SetItemText(hList, nRow, 0, buffer);
GetWindowText( hWnd, buffer, 512 );
ListView_SetItemText(hList, nRow, 1, buffer);
GetClassName( hWnd, buffer, 512 );
ListView_SetItemText(hList, nRow, 2, buffer);
GetWindowThreadProcessId( hWnd, &ProcessId );
wsprintf( buffer, "%ld", ProcessId );
ListView_SetItemText(hList, nRow, 3, buffer);
}
return TRUE;
}
| |