title: How to copy text including special characters to clipboard using C and WinAPI?
body: <p>I'm trying to make little c program that copies text to clipboard. I found this question asked on this website. Programs code:</p>
  
  <pre><code>const char* output = "Test";
  const size_t len = strlen(output) + 1;
  HGLOBAL hMem =  GlobalAlloc(GMEM_MOVEABLE, len);
  memcpy(GlobalLock(hMem), output, len);
  GlobalUnlock(hMem);
  OpenClipboard(0);
  EmptyClipboard();
  SetClipboardData(CF_TEXT, hMem);
  CloseClipboard();
  </code></pre>
  
  <p>This program does copy text to clipboard. But i need it to copy 2 lines. So i try this:</p>
  
  <pre><code>const char* output = "Test1\nTest2";
  </code></pre>
  
  <p>But it gets copied as literal. How can i fix this code so result would be:</p>
  
  <pre><code>Test1
  Test2
  </code></pre>
  
  <p>rather then:</p>
  
  <pre><code>Test1\nTest2
  </code></pre>