mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 19:14:56 -06:00
15.05
This commit is contained in:
committed by
Kornel Lesiński
parent
0713a3ab80
commit
54490d51d5
@@ -114,13 +114,18 @@ bool MySetWindowText(HWND wnd, LPCWSTR s)
|
||||
bool CWindow::GetText(CSysString &s)
|
||||
{
|
||||
s.Empty();
|
||||
int length = GetTextLength();
|
||||
if (length == 0)
|
||||
int len = GetTextLength();
|
||||
if (len == 0)
|
||||
return (::GetLastError() == ERROR_SUCCESS);
|
||||
TCHAR *p = s.GetBuf(len);
|
||||
{
|
||||
int len2 = GetText(p, len + 1);
|
||||
if (len > len2)
|
||||
len = len2;
|
||||
}
|
||||
s.ReleaseBuf_CalcLen(len);
|
||||
if (len == 0)
|
||||
return (::GetLastError() == ERROR_SUCCESS);
|
||||
length = GetText(s.GetBuffer(length), length + 1);
|
||||
s.ReleaseBuffer();
|
||||
if (length == 0)
|
||||
return (::GetLastError() != ERROR_SUCCESS);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -130,18 +135,23 @@ bool CWindow::GetText(UString &s)
|
||||
if (g_IsNT)
|
||||
{
|
||||
s.Empty();
|
||||
int length = GetWindowTextLengthW(_window);
|
||||
if (length == 0)
|
||||
int len = GetWindowTextLengthW(_window);
|
||||
if (len == 0)
|
||||
return (::GetLastError() == ERROR_SUCCESS);
|
||||
length = GetWindowTextW(_window, s.GetBuffer(length), length + 1);
|
||||
s.ReleaseBuffer();
|
||||
if (length == 0)
|
||||
wchar_t *p = s.GetBuf(len);
|
||||
{
|
||||
int len2 = GetWindowTextW(_window, p, len + 1);
|
||||
if (len > len2)
|
||||
len = len2;
|
||||
}
|
||||
s.ReleaseBuf_CalcLen(len);
|
||||
if (len == 0)
|
||||
return (::GetLastError() == ERROR_SUCCESS);
|
||||
return true;
|
||||
}
|
||||
CSysString sysString;
|
||||
bool result = GetText(sysString);
|
||||
s = GetUnicodeString(sysString);
|
||||
MultiByteToUnicodeString2(s, sysString);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user