Commit 65f23a74 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/button: Use messages to get control text.

parent b6ca8fd2
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment