title: Send Message in C#
body: <p>I'm creating an application that uses a main project that is connected to several different DLLs. From one DLL window I need to be able to open a window in another but the DLL's can't reference each other. </p>
  
  <p>It was suggested to me to use the sendmessage function in the first DLL and have a listener in the main program that directs that message to the appropriate DLL to open it's window. </p>
  
  <p>However I'm not familiar at all with the sendmessage function and am having a lot of diffculty piecing things together from information I'm finding online. </p>
  
  <p>If someone could please show me the correct way (if there is any) to use the sendmessage function and maybe how a listener captures that message that would be amazing. Here is some of the code I've got so far I'm not sure if I'm heading in the right direction.</p>
  
  <pre><code>    [DllImport("user32.dll")]
      public static extern int FindWindow(string lpClassName, String lpWindowName);
      [DllImport("user32.dll")]
      public static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
  
      public void button1_Click(object sender, EventArgs e)
      {
          int WindowToFind = FindWindow(null, "Form1");
      }
  </code></pre>