diff --git a/src/misc.c b/src/misc.c index 607b07052..13055eff4 100644 --- a/src/misc.c +++ b/src/misc.c @@ -3,14 +3,6 @@ #include #include #include -#ifdef WIN32 -#include -#include "update.h" -#endif -#ifdef MACOSX -///#include -#include -#endif #include "misc.h" #include "defines.h" #include "interface.h" @@ -19,6 +11,9 @@ #if defined WIN32 #include #endif +#ifdef MACOSX +#include +#endif //Signum function #if defined(WIN32) && !defined(__GNUC__) @@ -391,6 +386,23 @@ void clipboard_push_text(char * text) CFDataRef data = CFDataCreate(kCFAllocatorDefault, text, strlen(text)); PasteboardPutItemFlavor(newclipboard, (PasteboardItemID)1, CFSTR("com.apple.traditional-mac-plain-text"), data, 0); +#elif defined WIN32 + if(OpenClipboard()) + { + HGLOBAL cbuffer; + char * glbuffer; + + EmptyClipboard(); + + cbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(text)+1); + glbuffer = (char*)GlobalLock(cbuffer); + + strcpy(glbuffer, text); + + GlobalUnlock(cbuffer); + SetClipboardData(CF_TEXT, cbuffer); + CloseClipboard(); + } #else printf("Not implemented: put text on clipboard \"%s\"\n", text); #endif