[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, Int32 wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam);
public const int WM_GETTEXT = 0x000D;

In the function I'd like to get the text in an edit box
I call it like this

SendMessage(p, Win32System.WM_GETTEXT, wtxt.Capacity, wtxt);

where p is the handle to the editbox, wtxt is a stringbuilder instance
But the string value I get finally always the first character of the editbox

Could someone please help me ?

Thank you