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

int copy(const char* stuff, int length) {
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, length);
memcpy(GlobalLock(hMem), output, length);
GlobalUnlock(hMem);
OpenClipboard(0);
EmptyClipboard();
SetClipboardData(CF_TEXT, hMem);
CloseClipboard();
return 0;
}