MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetText

Method SetText

Source/Engine/Platform/Windows/WindowsClipboard.cpp:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void WindowsClipboard::SetText(const StringView& text)
25{
26 const int32 sizeWithoutNull = text.Length() * sizeof(Char);
27 const HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeWithoutNull + sizeof(Char));
28
29 Char* pMem = static_cast<Char*>(GlobalLock(hMem));
30 Platform::MemoryCopy(pMem, text.GetText(), sizeWithoutNull);
31 Platform::MemorySet(pMem + text.Length(), sizeof(Char), 0);
32 GlobalUnlock(hMem);
33
34 OpenClipboard(nullptr);
35 EmptyClipboard();
36 SetClipboardData(CF_UNICODETEXT, hMem);
37 CloseClipboard();
38}
39
40void WindowsClipboard::SetRawData(const Span<byte>& data)
41{

Callers

nothing calls this directly

Calls 3

MemorySetFunction · 0.85
LengthMethod · 0.45
GetTextMethod · 0.45

Tested by

no test coverage detected