The 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.
Syntax
To send this message, call the SendMessage function as follows. lResult = SendMessage( // returns LRESULT in lResult hWndControl, // (HWND) handle to destination control EM_SETTARGETDEVICE, // (UINT) message ID wParam, // = () wParam; lParam // = () lParam; );
lResult = SendMessage( // returns LRESULT in lResult hWndControl, // (HWND) handle to destination control EM_SETTARGETDEVICE, // (UINT) message ID wParam, // = () wParam; lParam // = () lParam; );
Parameters
wParam handle to a device context (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.
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.
Message Information
HeaderDeclared in Richedit.hMinimum operating systems Windows 95, Windows NT 4.0