Now is there anything wrong with this code...
HANDLE dat = (HANDLE)malloc(256); // allocate memorydat = memset(dat, 'A', 256); // set it to all A's*((char *)dat) + 255) = '\0'; // terminate with NULLwhile (!OpenClipboard(NULL)) ; // open clipboard for current windowSetClipboardData(CF_TEXT, dat); // set clipboardCloseClipboard(); // close clipboard
Everytime I try to do this, Windows crashes (no blue screen or anything, just locks up totally). I haven't been able to work out why it doesn't work.
Can anyone help?
Cheers,
leroy.