2020-04-09 05:39:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
inline static stdstr GetCWindowText(const CWindow *window)
|
|
|
|
{
|
|
|
|
stdstr Result;
|
2020-05-12 12:19:05 +00:00
|
|
|
int nLen = ::GetWindowTextLengthW(window->m_hWnd);
|
2020-04-09 05:39:31 +00:00
|
|
|
if (nLen == 0)
|
|
|
|
{
|
|
|
|
return Result;
|
|
|
|
}
|
2020-05-12 12:19:05 +00:00
|
|
|
std::wstring WindowText;
|
|
|
|
WindowText.resize(nLen + 1);
|
|
|
|
::GetWindowTextW(window->m_hWnd, (wchar_t *)WindowText.c_str(), nLen + 1);
|
|
|
|
return Result.FromUTF16(WindowText.c_str());
|
2020-04-09 05:39:31 +00:00
|
|
|
}
|