project64/Source/Project64/UserInterface/WTLControls/GetCWindowText.cpp

18 lines
410 B
C++
Raw Normal View History

#include "stdafx.h"
2022-09-21 05:16:07 +00:00
#include "GetCWindowText.h"
2021-02-28 21:32:50 +00:00
#include <Common/StdString.h>
std::string GetCWindowText(const CWindow & window)
{
int nLen = window.GetWindowTextLength();
if (nLen == 0)
{
return "";
}
std::wstring WindowText;
WindowText.resize(nLen + 1);
window.GetWindowText((wchar_t *)WindowText.c_str(), nLen + 1);
return stdstr().FromUTF16(WindowText.c_str());
2021-03-17 09:26:27 +00:00
}