Generally speaking, you should not create windows in different threads. The general recommendation is to use the main thread (and only the main thread) responsible for all GUI work. Worker threads can be created and run for the purposes of executing non-GUI related work, and can PostMessage custom messages to the windows of the main thread, so as to display the results of the work.

There are exceptions to this rule, but it's not clear from your post whether there is a good reason for you to create a window from a secondary thread.

Mike