Well, I don't have time to write and test the program for you, but I
can point you toward the right classes and methods to use.
If you look at the Assembly class, you'll see that you can use the
GetTypes() method to get all of the types defined in the assembly. If
you need to look in assemblies that are called by your main program,
you can use GetExecutingAssembly to get the assembly for the executing
program, then GetReferencedAssemblies to follow the tree of referenced
assemblies from there.
For any particular assembly, as I mentioned you can use GetTypes() to
get the types defined in the assembly. For each type, you can do this:
foreach (assemblyType in assembly.GetTypes())
{
if (assemblyType.IsSubclassOf(typeof(System.Windows.Forms.Form)))
{
// You may need to use assemblyType.FullName here... I don't
know for sure.
System.Windows.Forms.Form f =
(System.Windows.Forms.Form)assembly.CreateInstance(assemblyType.Name,
false, System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.NonPublic, null, null, null, null);
foreach (Control c in f.Controls)
{
... do something with control c of form f ...
}
f.Dispose();
}
}