A collection of basic/generally desirable code I use across multiple C++ projects.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
289 B

1 year ago
  1. int copy(const char* stuff, int length) {
  2. HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, length);
  3. memcpy(GlobalLock(hMem), output, length);
  4. GlobalUnlock(hMem);
  5. OpenClipboard(0);
  6. EmptyClipboard();
  7. SetClipboardData(CF_TEXT, hMem);
  8. CloseClipboard();
  9. return 0;
  10. }