Use ImGui::SetClipboardText instead of inline function. (#1902)
This commit is contained in:
parent
cb4652b241
commit
9cd37dd81b
@ -32,28 +32,6 @@ namespace
|
|||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
{
|
{
|
||||||
static void set_clipboard(const char* message)
|
|
||||||
{
|
|
||||||
HGLOBAL h;
|
|
||||||
LPVOID p;
|
|
||||||
int size;
|
|
||||||
//calc the num of unicode char
|
|
||||||
size = MultiByteToWideChar(CP_UTF8, NULL, message, -1, NULL, 0);
|
|
||||||
if (!size)
|
|
||||||
return;
|
|
||||||
h = GlobalAlloc(GHND | GMEM_SHARE, size * 2);
|
|
||||||
if (!h)
|
|
||||||
return;
|
|
||||||
p = GlobalLock(h);
|
|
||||||
//utf8 to unicode
|
|
||||||
MultiByteToWideChar(CP_UTF8, NULL, message, -1, (LPWSTR)p, size);
|
|
||||||
GlobalUnlock(h);
|
|
||||||
OpenClipboard(NULL);
|
|
||||||
EmptyClipboard();
|
|
||||||
SetClipboardData(CF_UNICODETEXT, h);
|
|
||||||
CloseClipboard();
|
|
||||||
}
|
|
||||||
|
|
||||||
void debug::threads()
|
void debug::threads()
|
||||||
{
|
{
|
||||||
if (ImGui::BeginTabItem("Threads"))
|
if (ImGui::BeginTabItem("Threads"))
|
||||||
@ -129,12 +107,12 @@ namespace big
|
|||||||
ImGui::Text("Script Pointer: ");
|
ImGui::Text("Script Pointer: ");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(std::format("0x{:X}", (DWORD64)selected_thread).c_str()))
|
if (ImGui::Button(std::format("0x{:X}", (DWORD64)selected_thread).c_str()))
|
||||||
set_clipboard(std::format("0x{:X}", (DWORD64)selected_thread).c_str());
|
ImGui::SetClipboardText(std::format("0x{:X}", (DWORD64)selected_thread).c_str());
|
||||||
//Stack Pointer
|
//Stack Pointer
|
||||||
ImGui::Text("Stack Pointer: ");
|
ImGui::Text("Stack Pointer: ");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button(std::format("0x{:X}", (DWORD64)selected_thread->m_stack).c_str()))
|
if (ImGui::Button(std::format("0x{:X}", (DWORD64)selected_thread->m_stack).c_str()))
|
||||||
set_clipboard(std::format("0x{:X}", (DWORD64)selected_thread->m_stack).c_str());
|
ImGui::SetClipboardText(std::format("0x{:X}", (DWORD64)selected_thread->m_stack).c_str());
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text("Internal Stack Pointer: %d Stack Size: %d",
|
ImGui::Text("Internal Stack Pointer: %d Stack Size: %d",
|
||||||
selected_thread->m_context.m_stack_pointer, selected_thread->m_context.m_stack_size);
|
selected_thread->m_context.m_stack_pointer, selected_thread->m_context.m_stack_size);
|
||||||
|
Reference in New Issue
Block a user