Changeset 7736 for trunk/src/user32/clipboard.cpp
- Timestamp:
- Jan 7, 2002, 3:32:21 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/clipboard.cpp
r6254 r7736 1 /* $Id: clipboard.cpp,v 1.1 3 2001-07-08 15:51:41 sandervl Exp $ */1 /* $Id: clipboard.cpp,v 1.14 2002-01-07 14:32:21 sandervl Exp $ */ 2 2 3 3 /* … … 288 288 #else 289 289 dprintf(("USER32: SetClipboardData %x %x", uFormat, hClipObj)); 290 291 if(uFormat == CF_UNICODETEXT) 292 { 293 //have to translate to CF_TEXT, because WGSS doesn't understand 294 //unicode text 295 LPWSTR lpTextUnicode; 296 LPSTR lpTextAscii; 297 DWORD length; 298 HANDLE hClipObjAscii; 299 300 lpTextUnicode = (LPWSTR)GlobalLock(hClipObj); 301 if(lpTextUnicode == NULL) { 302 dprintf(("!ERROR!: Invalid handle!!")); 303 SetLastError(ERROR_INVALID_HANDLE); 304 return 0; 305 } 306 length = GlobalSize(hClipObj)/sizeof(WCHAR); 307 hClipObjAscii = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, length); 308 lpTextAscii = (LPSTR)GlobalLock(hClipObjAscii); 309 if(!hClipObjAscii || lpTextAscii == NULL || length == 0) { 310 dprintf(("!ERROR!: GlobalAlloc %d failed!!", length)); 311 SetLastError(ERROR_INVALID_HANDLE); 312 return 0; 313 } 314 WideCharToMultiByte(CP_ACP, 0, lpTextUnicode, -1, lpTextAscii, length, 0, NULL); 315 316 GlobalUnlock(hClipObjAscii); 317 GlobalUnlock(hClipObj); 318 HANDLE ret = O32_SetClipboardData(CF_TEXT, hClipObjAscii); 319 //hClipObjAscii will be freed when the clipboard is closed 320 return ret; 321 } 290 322 return O32_SetClipboardData(uFormat, hClipObj); 291 323 #endif
Note:
See TracChangeset
for help on using the changeset viewer.