Advertisement
Mysoft

Untitled

Dec 26th, 2015
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. char* getData() {
  2.     if (OpenClipboard(NULL) == 0)
  3.         puts("No such luck!");
  4.     HGLOBAL hData = GetClipboardData(CF_TEXT);    
  5.     char* pzData = GlobalLock(hData);
  6.     int iDataSz = GlobalSize(hData);
  7.     char* pzResult = calloc( strnlen( pzData , iDataSz ) + 1 );
  8.     memcpy( pzResult , pzData , iDataSz );
  9.     GlobalUnlock(hData);
  10.     return pzResult;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement