Rewritten window objects.

[MOD] Rewritten window objects.
[FIX] Fixed the exit error.