title: Use WM_COPYDATA to send data between processes
body: <p>I wish to send text between processes. I have found lots of examples of this but none that I can get working. Here is what I have so far:</p>
  
  <p>for the sending part:</p>
  
  <pre><code>COPYDATASTRUCT CDS;
  CDS.dwData = 1;
  CDS.cbData = 8;
  CDS.lpData = NULL;
  SendMessage(hwnd, WM_COPYDATA , (WPARAM)hwnd, (LPARAM) (LPVOID) &amp;CDS);
  </code></pre>
  
  <p>the receiving part:</p>
  
  <pre><code>case WM_COPYDATA:
  COPYDATASTRUCT* cds = (COPYDATASTRUCT*) lParam;
  </code></pre>
  
  <p>I dont know how to construct the <code>COPYDATASTRUCT</code>, I have just put something in that seems to work. When debugging the <code>WM_COPYDATA</code> case is executed, but again I dont know what to do with the <code>COPYDATASTRUCT</code>.</p>
  
  <p>I would like to send text between the two processes. </p>
  
  <p>As you can probably tell I am just starting out, I am using GNU GCC Compiler in Code::Blocks, I am trying to avoid MFC and dependencies. </p>