December 15th, 2010, 01:50 AM
[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 ?
December 15th, 2010, 01:54 AM
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback
you think my response deserves recognition? perhaps you may want to click the Rate this post
link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
December 15th, 2010, 02:01 AM
Thank you, I delete CharSet and it works!
Should have made more checks before asking.
Click Here to Expand Forum to Full Width