Code: Select all
SYS"LoadLibrary","RICHED20.DLL"
textbox%=FN_createwindow(@hwnd%,"RichEdit20W","",354,4,344,246,0,&200044,0)
Code: Select all
DIMcharrange{cpmin%,cpmax%}
Code: Select all
REM EM_EXGETSEL=&434
SYS"SendMessage",textbox%,&434,0,charrange{}
IFcharrange.cpmin%>0THEN
j%=charrange.cpmin%
REM Find the start (F%) and end (L%) of the text and
REM move the text into a block of memory beginning at F%
REM WM_GETTEXTLENGTH=&E
SYS"SendMessage",textbox%,&E,0,0TOL%
SYS"GlobalAlloc",0,L%+1TOF%
REM WM_GETTEXT=&D
SYS"SendMessage",textbox%,&D,L%+1,F%
REM Bodge by adding in all carriage returns
l%=0:n%=0
REPEAT:l%-=((n%?F%)=13):n%+=1:UNTILn%=j%+l%
j%+=l%
ENDIF
Does anyone have a solution to this problem - or have I solved a problem that you too have been experiencing?