My knowledge of Windows programming is limited, but it looks like you can use
EnumChildWindows to loop through all child windows, calling
GetClassName for each child and checking if the text "RichEdit" is contained in the string that holds the class name.