pb中获取多行文本编辑框(mle控件)指定行的内容

//API函数定义

function long SendMessage(ulong hWnd, uint msg, long wParam, ref string lParam) library "user32.dll" alias for "SendMessageA"



 

//取第row行的文本

constant long EM_GETLINE = 196
string ls
ulong length, row
row = 2 //取第几行
ls = space(1000)
length = SendMessage(handle(mle_1), EM_GETLINE, row - 1, ls) //row - 1表示取得第row行的文本,0为起始
ls = trim(ls)
messagebox("取第" + string(row) + "行", "文本内容:" + ls + "~r~n文本长度:" + string(length))


 

你可能感兴趣的:(String,function,user,library,文本编辑)