Windows clipboard_pull_text() implementation (untested)

This commit is contained in:
Simon Robertshaw 2011-07-06 14:01:47 +01:00
parent 82a05ddd3c
commit 5f62bc74c9

View File

@ -440,8 +440,28 @@ void clipboard_push_text(char * text)
char * clipboard_pull_text()
{
#ifdef MACOSX
#elif defined WIN32
if (OpenClipboard(NULL))
{
HANDLE cbuffer;
char * glbuffer;
cbuffer = GetClipboardData(CF_TEXT);
glbuffer = (char*)GlobalLock(cbuffer);
GlobalUnlock(cbuffer);
CloseClipboard();
if(glbuffer!=NULL){
return mystrdup(glbuffer);
} else {
return "";
}
}
#elif (defined(LIN32) || defined(LIN64)) && defined(SDL_VIDEO_DRIVER_X11)
#else
printf("Not implemented: get text from clipboard\n");
return "";
#endif
}
int register_extension()