Are Windows Win32 threads safe?

I would like to create a window in one thread and then transfer this HWND to any number of threads on which it will run. My program will have several such windows. Is this possible or was the Win32 API not intended for this?

+5
source share
4 answers

No, It is Immpossible. The thread that the window uses for its message loop (what you call "runner") is determined during window creation. You can create multiple threads and run message loops from them (and thereby create windows on them), but this is usually considered dangerous.

+6
source

Yes, to a certain extent.

HWND .

http://msdn.microsoft.com/en-us/library/ms644944 (v = VS.85).aspx

(, ) . , , , .

+10

, concurrency.

+2

, : CreateWindow GetMessage ( ). , .

PostMessage . SendMessage , .

+2

All Articles