2020-08-04 12:58:40 +00:00
|
|
|
#include "stdafx.h"
|
2022-09-21 05:16:07 +00:00
|
|
|
|
2020-08-04 12:58:40 +00:00
|
|
|
#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());
|
2021-03-17 09:26:27 +00:00
|
|
|
}
|