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