void *lock;
HGLOBAL clipdata2; int len2; void *lock, *lock2;
void write_clip(void *data, int len, int must_deselect){    HGLOBAL clipdata;    void *lock;    clipdata = GlobalAlloc(GMEM_DDESHARE | GMEM_MOVEABLE, len + 1);    if (!clipdata)	return;    lock = GlobalLock(clipdata);    if (!lock)	return;    memcpy(lock, data, len);    ((unsigned char *) lock)[len] = 0;    GlobalUnlock(clipdata);    if (!must_deselect)	SendMessage(hwnd, WM_IGNORE_CLIP, TRUE, 0);    if (OpenClipboard(hwnd)) {	EmptyClipboard();	SetClipboardData(CF_TEXT, clipdata);	CloseClipboard();    } else	GlobalFree(clipdata);    if (!must_deselect)	SendMessage(hwnd, WM_IGNORE_CLIP, FALSE, 0);}