EnumWindows() is what I would use in this case too.