Nikolay Sivov : comctl32/button: Use messages to get control text.

Alexandre Julliard julliard at winehq.org
Tue Feb 13 13:57:56 CST 2018


Module: wine
Branch: master
Commit: 65f23a745ad44dee50d451f063943ca80598e3c4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=65f23a745ad44dee50d451f063943ca80598e3c4

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Feb 13 16:19:57 2018 +0300

comctl32/button: Use messages to get control text.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/button.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c
index 2f5a5b3..dccddf9 100644
--- a/dlls/comctl32/button.c
+++ b/dlls/comctl32/button.c
@@ -223,9 +223,10 @@ static inline void paint_button( HWND hwnd, LONG style, UINT action )
 /* retrieve the button text; returned buffer must be freed by caller */
 static inline WCHAR *get_button_text( HWND hwnd )
 {
-    static const INT len = 512;
+    INT len = GetWindowTextLengthW( hwnd );
     WCHAR *buffer = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) );
-    if (buffer) InternalGetWindowText( hwnd, buffer, len + 1 );
+    if (buffer)
+        GetWindowTextW( hwnd, buffer, len + 1 );
     return buffer;
 }
 




More information about the wine-cvs mailing list