public static IEnumerable<IntPtr> EnumChildWindows(IntPtr parentHandle)
{
// Create the list of windows
var list = new List<IntPtr>();
// Create the callback
EnumWindowsProc callback = delegate(IntPtr windowHandle, IntPtr lParam)
{
list.Add(windowHandle);
return true;
};
// Enumerate all windows
NativeMethods.EnumChildWindows(parentHandle, callback, IntPtr.Zero);
// Returns the list of the windows
return list.ToArray();
}