Window handles are shared by default, just as you can find them through FindWindow
or FindWindowEx
. What you want is a bit like socket communication, client-server-client transit protocol. It's just that sockets are more powerful and can be used on different machines.
You can communicate between processes by defining your own WM_*
message type, and you can control "multi-to-multi" inter-process communication. But it is not practical in practice (if ugliness is not taken into account), it is not as powerful as socket, not as mature as socket's technology, more resource occupied(because of visible window).
Of course, as @IInspectable said, there is another way of message-only windows. But the window is not visible, which is not "intuitive". Getting a window handle is as "ugly" as opening a file. It's like encapsulating a message queue into an invisible window.
In addition, if the window is accidentally closed, the communication will fail.
So summary: You can use the visible window to communicate between processes according to your preferences, but this method is not practical (unless there is a special need).