diff options
Diffstat (limited to 'CPP/Windows/Window.cpp')
| -rw-r--r-- | CPP/Windows/Window.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/CPP/Windows/Window.cpp b/CPP/Windows/Window.cpp index 32af4aa..102c503 100644 --- a/CPP/Windows/Window.cpp +++ b/CPP/Windows/Window.cpp | |||
| @@ -111,7 +111,7 @@ bool MySetWindowText(HWND wnd, LPCWSTR s) | |||
| 111 | } | 111 | } |
| 112 | #endif | 112 | #endif |
| 113 | 113 | ||
| 114 | bool CWindow::GetText(CSysString &s) | 114 | bool CWindow::GetText(CSysString &s) const |
| 115 | { | 115 | { |
| 116 | s.Empty(); | 116 | s.Empty(); |
| 117 | unsigned len = (unsigned)GetTextLength(); | 117 | unsigned len = (unsigned)GetTextLength(); |
| @@ -119,7 +119,7 @@ bool CWindow::GetText(CSysString &s) | |||
| 119 | return (::GetLastError() == ERROR_SUCCESS); | 119 | return (::GetLastError() == ERROR_SUCCESS); |
| 120 | TCHAR *p = s.GetBuf(len); | 120 | TCHAR *p = s.GetBuf(len); |
| 121 | { | 121 | { |
| 122 | unsigned len2 = (unsigned)GetText(p, (int)(len + 1)); | 122 | const unsigned len2 = (unsigned)GetText(p, (int)(len + 1)); |
| 123 | if (len > len2) | 123 | if (len > len2) |
| 124 | len = len2; | 124 | len = len2; |
| 125 | } | 125 | } |
| @@ -130,7 +130,7 @@ bool CWindow::GetText(CSysString &s) | |||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | #ifndef _UNICODE | 132 | #ifndef _UNICODE |
| 133 | bool CWindow::GetText(UString &s) | 133 | bool CWindow::GetText(UString &s) const |
| 134 | { | 134 | { |
| 135 | if (g_IsNT) | 135 | if (g_IsNT) |
| 136 | { | 136 | { |
| @@ -140,7 +140,7 @@ bool CWindow::GetText(UString &s) | |||
| 140 | return (::GetLastError() == ERROR_SUCCESS); | 140 | return (::GetLastError() == ERROR_SUCCESS); |
| 141 | wchar_t *p = s.GetBuf(len); | 141 | wchar_t *p = s.GetBuf(len); |
| 142 | { | 142 | { |
| 143 | unsigned len2 = (unsigned)GetWindowTextW(_window, p, (int)(len + 1)); | 143 | const unsigned len2 = (unsigned)GetWindowTextW(_window, p, (int)(len + 1)); |
| 144 | if (len > len2) | 144 | if (len > len2) |
| 145 | len = len2; | 145 | len = len2; |
| 146 | } | 146 | } |
| @@ -150,7 +150,7 @@ bool CWindow::GetText(UString &s) | |||
| 150 | return true; | 150 | return true; |
| 151 | } | 151 | } |
| 152 | CSysString sysString; | 152 | CSysString sysString; |
| 153 | bool result = GetText(sysString); | 153 | const bool result = GetText(sysString); |
| 154 | MultiByteToUnicodeString2(s, sysString); | 154 | MultiByteToUnicodeString2(s, sysString); |
| 155 | return result; | 155 | return result; |
| 156 | } | 156 | } |
