Calling Win32 API SendMessage in C# richtextbox to copy selected text returns one character less -
I am trying to copy the selected text in the active window by using the Win32 API SendMessage as the following text < / P>
[DllImport ("user32.dll")] Public static extern int SendMessage (IntPtr hWnd, uint message, out int wParam, out int lParam); Int start, next; SendMessage (activeVandial, 0xB0, start out, out next);
This gives the starting and closing character status of selected text. It works fine in Notepad or any system. Windows.Forms.TextBox but it's calling for a system. Windows .form. Reach textbox reduces a character. Anyone know why ?? And how it works.
Send message should be really
public static extern int SendMessage (IntPtr hWnd, uint message, int wParam, int lParam);
WPAMM and LPARM are actually input, not output. Therefore, you are sending garbage, and are lucky to get some back.
Comments
Post a Comment