#include <config.h>
#include "lisp.h"
+#include "frame.h"
#include "select.h"
#include "console-msw.h"
int rawsize, size, i;
unsigned char *src, *dst, *next;
HGLOBAL h = NULL;
+ struct frame *f = NULL;
CHECK_STRING (string);
if (src[i] == '\n')
size++;
- if (!OpenClipboard (NULL))
+ f = selected_frame ();
+ if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f)))
return Qnil;
if (!EmptyClipboard () ||
i = (SetClipboardData (CF_TEXT, h) != NULL);
CloseClipboard ();
- GlobalFree (h);
return i ? Qt : Qnil;
}
*/
())
{
- return EmptyClipboard () ? Qt : Qnil;
+ BOOL success = OpenClipboard (NULL);
+ if (success)
+ {
+ success = EmptyClipboard ();
+ /* Close it regardless of whether empty worked. */
+ if (!CloseClipboard ())
+ success = FALSE;
+ }
+
+ return success ? Qt : Qnil;
}
static void