switch to proper for-loop
Merge pull request #1939 from Cobinja/createwindowclone-for-loop

Switch to proper for-loop in createWindowClone