HANDLE stringData; char string[4096]; if (OpenClipboard(0)) { if ((stringData = GetClipboardData(CF_TEXT)) != NULL) { strncpy(string, (char *) stringData, 4096); string[4095] = '\0'; // Truncate if needed CloseClipboard(); return string ; } else CloseClipboard(); }
MSDN
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)