win32 保存数据到剪切板

char cD[] ="http://rfb.";
if(OpenClipboard(NULL))
{

HGLOBAL hmem=GlobalAlloc(GHND,20);
char *pmem=(char*)GlobalLock(hmem);

EmptyClipboard();
memcpy(pmem,cD,20);
SetClipboardData(CF_TEXT,hmem);
CloseClipboard();
GlobalFree(hmem);
}

wchar 转成char

const WCHAR* guid

char test[6];
int ret;
ret = wcstombs ( test, guid, sizeof(test) );

posted on 2012-11-27 17:25  GIS-MAN  阅读(249)  评论(0编辑  收藏  举报

导航