title: Getting byte[] from GetClipboardData native method
body: <p>I'm trying to get the Clipboard data using <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms649039(v=vs.85).aspx" rel="nofollow">this native method</a> with C#/.NET. The problem is I'm mangling the data. Here's my code:</p>
  
  <pre><code>IntPtr pointer = GetClipboardData(dataformat);
  int size = Marshal.SizeOf(pointer);
  byte[] buff = new byte[size];
  Marshal.Copy(data, buff, 0, size);
  </code></pre>
  
  <p>Here's the pinvoke I'm using for the GetClipboardData method:</p>
  
  <pre><code>[DllImport("user32.dll")]
  private static extern IntPtr GetClipboardData(uint uFormat);
  </code></pre>
  
  <p>Can anyone tell me where I'm going wrong?</p>