Minor tweaks and cleanup.

This commit is contained in:
Birunthan Mohanathas
2011-12-09 08:40:19 +00:00
parent 2835739b12
commit 13b3241307
9 changed files with 28 additions and 53 deletions

View File

@ -1157,16 +1157,13 @@ void CSystem::SetClipboardText(const std::wstring& text)
if (hMem)
{
LPVOID data = GlobalLock(hMem);
if (data)
{
memcpy(data, text.c_str(), len * sizeof(WCHAR));
GlobalUnlock(hMem);
memcpy(data, text.c_str(), len * sizeof(WCHAR));
GlobalUnlock(hMem);
EmptyClipboard();
if (!SetClipboardData(CF_UNICODETEXT, hMem))
{
GlobalFree(hMem);
}
EmptyClipboard();
if (!SetClipboardData(CF_UNICODETEXT, hMem))
{
GlobalFree(hMem);
}
}