I'm trying to determine some of the details of how HWND_BROADCAST
works. Unfortunately, MSDN doesn't have a specific page for this value; it's only mentioned in passing in several other articles, such as the ones for SendMessage
and PostMessage
.
What I specifically want to know is whether messages sent to HWND_BROADCAST
are received by windows associated with other desktops in the same window station. The docs say the message will go to "all top-level windows in the system", but clearly that can't be strictly true. For instance, I'm sure they wouldn't go to windows in other logon sessions (e.g. on a terminal server). My guess is that they are at least limited to the window station of the calling process, but I don't know if they are also limited to the desktop of the calling thread (each thread is associated with a single desktop).
Worst case I can go write some code to test this empirically, but does anybody happen to know the answer already?