EM_SETTARGETDEVICE message

Sets the target device and line width used for "what you see is what you get" (WYSIWYG) formatting in a rich edit control.

Parameters

wParam

HDC for the target device.

lParam

Line width to use for formatting.

Return value

The return value is zero if the operation fails, or nonzero if it succeeds.

Remarks

The HDC for the default printer can be obtained as follows.

PRINTDLG pd = { sizeof(pd) };
pd.Flags = PD_RETURNDC | PD_RETURNDEFAULT;
if (PrintDlg(&pd))
{
    HDC hdc = pd.hDC;
    ...
}

If lParam is zero, no line breaks are created.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Richedit.h