I am trying to send a message using myresult=SendMessage(hWnd,...). As I understand it, SendMessage sends a Windows message to the specified target hWnd; the target's WndProc returns a long value; that value is returned by SendMessage (myresult). Am I right so far?
Ok, now if the SendMessage hWnd is HWND_BROADCAST, it is sent to all top-level windows. So which window's WndProc determines the return value?
UPDATE: 02-10-20
Just to clear up what I hoped to do...
My app consists of a small constellation of windows apps that need to communicate via Windows Messages. My plan was to broadcast a registered message, e.g., WM_IDENTIFYMYAPP, and identify all siblings by responses. That won't for the reason explained in the answer by Adrian Mole.
WM_SYSCOLORCHANGE
andWM_DEVMODECHANGE
, i.e. messages that are intended to be notifications. I don't know what ultimately decides the return value ofSendMessage
, but have not ever found it to be useful for anything either. – IInspectableHWND_BROADCAST
except for the notification-style messages mentioned by IInspectable (and DDE, which no one should be using these days). – Jonathan Potter