2020-08-04 12:58:40 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "GetCWindowText.h"
|
2021-02-28 21:32:50 +00:00
|
|
|
#include <Common/StdString.h>
|
2020-08-04 12:58:40 +00:00
|
|
|
|
|
|
|
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());
|
|
|
|
}
|