Hi!

If string is too long I use
invoke SendMessage, hRichEd,EM_SETTARGETDEVICE, 0, 0
and every strings became visible. But if I'll want to print them this method can not be used. Before printing I must reformat text because line length must be approx. 70 characters. How to do this?

Mike
Posted on 2004-06-23 01:53:40 by Mike
Mike
setWYSIWYG proc hwndRE:HWND

local pdlg:PRINTDLG
local pt:POINT
local xPerInch:dword

invoke RtlZeroMemory, addr pdlg, sizeof pdlg
mov pdlg.lStructSize, sizeof pdlg
mov pdlg.Flags, PD_RETURNDC or PD_RETURNDEFAULT
invoke PrintDlg, addr pdlg
.if eax != 0
.if pdlg.hDevMode != NULL
invoke GlobalFree, pdlg.hDevMode
.endif
.if pdlg.hDevNames != NULL
invoke GlobalFree, pdlg.hDevNames
.endif
invoke SetMapMode, pdlg.hDC, MM_TEXT
invoke GetDeviceCaps, pdlg.hDC, LOGPIXELSX
mov xPerInch,eax
invoke Escape, pdlg.hDC, GETPHYSPAGESIZE, 0, NULL, addr pt
.if eax > 0
invoke MulDiv, pt.x, 1440, xPerInch
.else
invoke GetDeviceCaps, pdlg.hDC, HORZRES
invoke MulDiv, eax, 1440, xPerInch
.endif
invoke SendMessage, hwndRE, EM_SETTARGETDEVICE, pdlg.hDC, eax
invoke DeleteDC, pdlg.hDC
.endif

ret
setWYSIWYG endp
Posted on 2004-06-27 22:47:23 by P2M
Thank you, P2M, I'll try it.
Posted on 2004-06-28 00:17:58 by Mike