diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-11 22:17:00 +0100 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-11 22:17:00 +0100 |
| commit | a5e78ec91b1c59233260bc776a309804352cd817 (patch) | |
| tree | ab88e61ce27383a61c63b46e931d62b161f1e5e2 /alf/alf.cpp | |
| parent | 3ecdf8ec97ee6a0b7453f7b4d0c58a84916cfab0 (diff) | |
ALF_Text(): use GetWindowText instead of sending WM_GETTEXT directly
Diffstat (limited to 'alf/alf.cpp')
| -rw-r--r-- | alf/alf.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp index 57059d2..f10bdd3 100644 --- a/alf/alf.cpp +++ b/alf/alf.cpp @@ -593,10 +593,10 @@ ALF_SetWidgetText(HWND parent, WORD id, const TCHAR *text) TCHAR * // free with HeapFree ALF_Text(HWND hwnd) { - int len = (int)SendMessage(hwnd, WM_GETTEXTLENGTH, 0, 0); + int len = GetWindowTextLengthA(hwnd); if (len > 0) { TCHAR *buf = (TCHAR*)HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS|HEAP_ZERO_MEMORY, (len + 1)*sizeof(TCHAR)); - if (SendMessage(hwnd, WM_GETTEXT, 0, (LPARAM)buf)) { + if (GetWindowText(hwnd, buf, len)) { return buf; } else { HeapFree(GetProcessHeap(), 0, buf); |
