Beispiel #1
0
        public static string GetText(RichTextBox rt)
        {
            int iCharLength = GetTextLength(rt) + 1;
            int iByteLength = 2 * iCharLength;

            GETTEXTEX GT = new GETTEXTEX();

            GT.iCb       = iByteLength;
            GT.iFlags    = GT_DEFAULT;
            GT.iCodepage = CP_UNICODE;

            StringBuilder SB = new StringBuilder(iCharLength);

            SendMessage(rt.Handle, EM_GETTEXTEX, ref GT, SB);
            string strText = SB.ToString();

            return(strText);
        }
Beispiel #2
0
 private static extern int SendMessage(IntPtr hWnd, int Msg, ref GETTEXTEX wParam, StringBuilder lParam);
Beispiel #3
0
        public static string GetText(RichTextBox rt)
        {
            int iCharLength = GetTextLength(rt) + 1;
            int iByteLength = 2 * iCharLength;

            GETTEXTEX GT = new GETTEXTEX();
            GT.iCb = iByteLength;
            GT.iFlags = GT_DEFAULT;
            GT.iCodepage = CP_UNICODE;

            StringBuilder SB = new StringBuilder(iCharLength);
            SendMessage(rt.Handle, EM_GETTEXTEX, ref GT, SB);
            string strText = SB.ToString();
            return strText;
        }
Beispiel #4
0
 internal static extern int SendMessage(IntPtr hWnd, int msg, ref GETTEXTEX wParam, System.Text.StringBuilder lParam);
 private static extern int SendMessage(IntPtr hWnd, int msg, ref GETTEXTEX wParam, StringBuilder lParam);
Beispiel #6
0
 public static extern int GetText(IntPtr hWnd, int Msg, ref GETTEXTEX wParam, StringBuilder lParam);
Beispiel #7
0
 private static extern void RichTextBox_GetTextEx(out GETTEXTEX value);