I even asked AI about this, and it thinks Raymond Chen said PostMessage can safely synchronize previous writes, but it cant locate the archive of the quote it produces.
One of the big problems about LLMs is that they can make invalid connections since it requires knowledge of the context that the information is used in. It is therefore able to come to conclusions that are just outright invalid. The worst part is that it can then output these results as fact.
I would imagine that one thing that muddies the water here is that the message queue is used as a mechanism for thread safety in multiple cases. One of the most common is marshalling to/from a STA thread. All that would be required here is some inaccurate English be used in a description and the LLM could then equate using the message queue to serialise access to a component with synchronising memory writes.
Its just PostMessage is a multi-threading/multi-process mechanism, so many people seem to think its safe to pass pointers through user-defined messages. There are some blogs where people make this claim without citations.
This is such a case of inaccurate English. The statement of "safe to pass pointers through user-defined messages" is not the same as PostMessage or GetMessage acting as a memory barrier.
It is, in fact, safe to pass pointers into user defined messages in special cases. In one application, I used a message to pass a COM interface pointer to a window. This was perfectly fine because the object's reference count had already been incremented, and the object was properly marshalled. But this is the whole reason why I state "in special cases". Passing pointers requires some extra protocol on top of the Windows message functionality.