summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alf/alf.cpp4
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);