The EM_SETTARGETDEVICE message sets the target device and line width used for WYSIWYG (what you see is what you get) formatting in a rich edit control.
EM_SETTARGETDEVICE
wParam = (WPARAM) (HDC) hdcTarget;
lParam = (LPARAM) (int) cxLineWidth;
Returns a nonzero value if successful or zero otherwise.
Windows NT: Requires version 3.51 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in richedit.h.
Rich Edit Controls Overview, Rich Edit Messages