I have this function, which i use with EnumWindows to put window titles in a list box and it works fine.
Code:
BOOL CALLBACK WindowsToListBox( HWND hwnd, LPARAM lParam )
{
char buff[500];
GetWindowText( hwnd, buff, sizeof( buff ) );
if( strlen( buff ) )
SendMessage( ( HWND ) lParam, LB_ADDSTRING, 0, (LPARAM) buff );
return TRUE;
}
It is called with:
EnumWindows( WindowsToListBox, ( LPARAM ) ListBox );
Where ListBox is a handle to the list box
However when I try to use EnumChildWindows it dosent work. I call it like this
Code:
EnumChildWindows( NULL, WindowsToListBox, ( LPARAM ) ListBox );
MSDN says that "when the first parameter is NULL EnumChildWindows behaves the same as EnumWindows". So how come it don't work?