In a discussion in the third party forum, I was motivated to write some code to toggle the wordwrap mode of a richedit control. I thought it would be as simple as changing some window styles, but that doesn't work. I searched the web and found an undocumented use of a strange richedit message which solved the problem.

Here is the DDT code to toggle wordwrap mode in the richedit:

Code:
SUB DDT_ToggleWordWrap(BYVAL hDlg&, BYVAL RichID&, BYVAL WrapFlag&)
    LOCAL hCtrl&, Op&, WS&, V&
    CONTROL HANDLE hDlg&, RichID& TO hCtrl&
    WS&=GetWindowLong(hCtrl&, %GWL_STYLE)
    IF WrapFlag& THEN
        WS&=WS& OR %WS_HSCROLL OR %ES_AUTOHSCROLL
        V&=1
    ELSE
        WS&=WS& AND NOT(%WS_HSCROLL OR %ES_AUTOHSCROLL)
        V&=0
    END IF
    SetWindowLong hCtrl&, %GWL_STYLE, WS&
    SetWindowPos hCtrl&, 0,0,0,0,0,%SWP_DRAWFRAME OR %SWP_FRAMECHANGED OR %SWP_NOMOVE OR %SWP_NOOWNERZORDER OR %SWP_NOSIZE OR %SWP_NOZORDER
    SendMessage hCtrl&, %EM_SETTARGETDEVICE, 0,V&
END SUB

This is the only reference I found to this on the MSDN web site (and it is a comment left by a user).
http://msdn.microsoft.com/en-us/libr...82(VS.85).aspx
There are a number of web pages on the internet that do make reference to this feature.