| 450 | } |
| 451 | |
| 452 | std::wstring GetWindowText(HWND hWnd) |
| 453 | { |
| 454 | int length = ::GetWindowTextLengthW(hWnd); |
| 455 | std::vector<wchar_t> text(length + 1); |
| 456 | if (::GetWindowTextW(hWnd, text.data(), length + 1) == 0) |
| 457 | { |
| 458 | if (auto err = GetLastError()) |
| 459 | throw Win32Error(err, "GetWindowText"); |
| 460 | } |
| 461 | return std::wstring(text.data(), length); |
| 462 | } |
| 463 | |
| 464 | std::wstring GetDlgItemText(HWND hDlg, int idc) |
| 465 | { |
no test coverage detected