在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
function TForm1.GetSendText(RichEdit: TExRichEdit): string;
var MsgListInfo: TStrings; i, m, n: integer; x, y: LongInt; WideStr: WideString; begin Result := ''; MsgListInfo := RichEdit.Lines; Y := SendMessage(RichEdit.Handle, EM_LINEFROMCHAR, MsgList.SelStart, 0); //得到rich光标所在行与列 X := RichEdit.SelStart - SendMessage(RichEdit.Handle, EM_LINEINDEX, Y, 0); if RichEdit.SelLength = 0 then begin for i := y downto 0 do begin m := Pos('[', MsgListInfo.Strings[i]); n := Pos(']', MsgListInfo.Strings[i]); if (m = 1) and (n = 21) then begin Result := Copy(MsgListInfo.Strings[i], m + 1, n - 2); Break; end; end; end else begin WideStr := MsgListInfo.Strings[y]; Result :=Copy(WideStr, x + 1, RichEdit.SelLength); end; end; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论