by César E. Lozada » Fri Mar 30, 2007 2:35 am
Use riched20.dll version 5.50 or upper and you will see rtf files rightly showed. Also, you can zoom rtf and previews are as expected. Zooming methods are listed below and must be called with %zoom, example, oRtf:SetZoom(65) //65%
Add to tRichEd class (or extend class)
DATA nW0
#define EM_GETZOOM (WM_USER + 224)
#define EM_SETZOOM (WM_USER + 225)
METHOD SetZoom(nZoom)
METHOD GetZoom(nZoom)
METHOD SetZoom(nZoom)
Local nNum:=nZoom, nDen:=100, k
DEFAULT ::nW0:=::nWidth-20
FOR k:=2 to 5 step 3
DO WHILE nNum%k=0 .and. nDen%k=0
nNum/=k; nDen/=k
ENDDO
NEXT
IF nNum>0 .and. nNum<64 .and. nDen>0 .and. nDen<64
::SetSize(::nW0*nZoom/100+20,::nHeight)
::SendMsg(EM_SETZOOM, nNum, nDen)
ENDIF
return nil
METHOD GetZoom()
Local nZoom,nNum:=0, nDen:=0
::SendMsg(EM_GETZOOM, nNum, nDen)
nZoom:=100*nNum/Max(nDen,1)
return nZoom
Regards.
César Lozada