mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/GabsPuNs-MinecraftConsoles.git
synced 2026-08-02 15:42:36 +00:00
Updates
This commit is contained in:
@@ -66,7 +66,20 @@ void Screen::setClipboard(const wstring& str)
|
||||
EmptyClipboard();
|
||||
size_t len = (str.length() + 1) * sizeof(wchar_t);
|
||||
HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, len);
|
||||
if (h) { memcpy(GlobalLock(h), str.c_str(), len); GlobalUnlock(h); SetClipboardData(CF_UNICODETEXT, h); }
|
||||
if (h)
|
||||
{
|
||||
void* ptr = GlobalLock(h);
|
||||
if (ptr)
|
||||
{
|
||||
memcpy_s(ptr, len, str.c_str(), len);
|
||||
GlobalUnlock(h);
|
||||
SetClipboardData(CF_UNICODETEXT, h);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalFree(h);
|
||||
}
|
||||
}
|
||||
CloseClipboard();
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user