Made access to the wnd struct thread-safe.

36 files changed