title: Send a message directly from a thread to an object without using the main form
body: <p>I'm using a 3rd party library that uses a lot of threads. </p>
  
  <p>I've just started using messages to communicate back to the main thread from a thread. It's all working, but using SendMessage the way I describe below seems cumbersome because <em>the main form has to dispatch all the messages.</em> Is there a way to send a message directly to a frame or object, without depending on the main form?</p>
  
  <p>At program startup:</p>
  
  <pre><code> MyMessageNumber1 :=  RegisterWindowMessage('MyUniqueID1');
   MyMessageNumber2 :=  RegisterWindowMessage('MyUniqueID2');
  </code></pre>
  
  <p>When sending a message without any data, I do:</p>
  
  <pre><code> SendMessage(Application.MainForm.Handle,  MyMessageNumber1) 
  </code></pre>
  
  <p>My main form has this:</p>
  
  <pre><code>procedure WndProc(var Message: TMessage); override;
  if (Message.Msg = MyMessageNumber1)
    ... call a frame or other object's method that handles this particular message
  else if (Message.Msg = MyMessageNumber2) then
    ... call another ....
  else
    inherited;
  </code></pre>
  
  <p>In summary: the above WndProc has to know far more than I'd prefer about all the messages and who to dispatch them to. </p>
  
  <p>How can I send a message directly from a thread in a way that any object can receive it?</p>
  
  <p>All of these messages have no data associated with them. (We'll get to that some other day!) :-) </p>
  
  <p>TIA</p>