there are two kind of thread in the windows,
working thread and GUI thread. In a process,
there is only one GUI thread can exist.
You will meet some trouble, if you use window
resource handle cross the thread directly.
My advice is that the working thread can send
message to the windows main loop. and the GUI
thread do the action according the message.