Removed a number of direct accesses to the WND structure, replacing
them by API calls.

19 files changed