Copying window contents

I'd be grateful for some help.
Is there any way to enumerate all open windows and then, for each one in
turn,
select the entire contents and copy the selection to with windows clipboard?
Ian