i want to make an option "wordwrap" in my program. in my win32.hlp i can read : "Using the default wordwrap function provided by Windows" in "wordwrap functions" topic. But if i send EM_SETWORDBREAKPROC message to my richedit, i need to supply my own EditWordBreakProc. Is there any possibility to use "the default wordwrap function provided by Windows". It isn't explain... and EM_SETWORDWRAPMODE seems to work only on asian language system (seen on microsoft msdn site). any idea?
Posted on 2001-03-24 17:05:00 by gael
gael, The normal method of doing wordwrap is to save the contents of the edit control in a buffer, destroy the edit control and create another with the style you want. Then load the contents back into the new control. Looks messy but it works fine and is no big deal.

    mov wStyle, WS_VISIBLE or ES_SUNKEN or \
                WS_CHILDWINDOW or WS_CLIPSIBLINGS or \
                ES_MULTILINE or WS_VSCROLL or \
                ES_AUTOVSCROLL or ES_NOHIDESEL

    .if WRAP == 0
      or wStyle, WS_HSCROLL or ES_AUTOHSCROLL
    .endif

    invoke CreateWindowEx,0,EditMl,0,wStyle,
                          a,b,wd,ht,hParent,ID,hInstance,NULL

    mov hndl, eax
Regards, hutch@pbq.com.au
Posted on 2001-03-24 18:29:00 by hutch--
Instead of creating and destroying an entire new edit control, surly you could use SetWindowLong to change the style of the edit control? Or does that not work?
Posted on 2001-03-24 18:42:00 by George
for rich edit control word wrapping, do this: for no word wrap: invoke SendMessage, hwndEdit,EM_SETTARGETDEVICE, NULL, 500000 for wrap-to-window: invoke SendMessage, hwndEdit,EM_SETTARGETDEVICE, NULL, 0 What you are doing is changing the right margin property, which is measured in TWIPs. Thus for no word wrap you set the value to a stupidly high value. good luck, bitnaut2
Posted on 2001-03-25 03:05:00 by bitnaut2
It's always a pleasure to ask something here :cool: bitnaut2 way is the easiest for me and work fine thx at all! :)
Posted on 2001-03-25 07:47:00 by gael