Example of ME_TextBuffer representation in rich edit control in Wine. by Thomas Kho 2006-01-30 ME_TextBuffer points into a doubly-linked list of ME_DisplayItem. An ME_DisplayItem is either a paragraph, row, or run [think of ME_DisplayItem as a superclass]. It is more intuitive to view the linked list as a tree: |---Paragraph1 | |---Row1 | | |---Run1 | | |---Run2 | | | |---Row2 | | |---Run1 | | |---Run2 | |---Paragraph2 | |---Row1 | | |---Run1 | | |---Run2 Sending the following message to set the contents of the rich edit control: SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "a\nthis is a very long line of text that should be longer than one screen-width\nc\nd\ne"); We get the following output from ME_DocumentDump(): trace:richedit_lists:ME_DumpDocument DOCUMENT DUMP START trace:richedit_lists:ME_DumpDocument Start trace:richedit_lists:ME_DumpDocument Paragraph(ofs=0) trace:richedit_lists:ME_DumpDocument - StartRow trace:richedit_lists:ME_DumpDocument - Run("L"a"", 0) trace:richedit_lists:ME_DumpDocument - Run("L"\00b6"", 1) trace:richedit_lists:ME_DumpDocument Paragraph(ofs=2) trace:richedit_lists:ME_DumpDocument - StartRow trace:richedit_lists:ME_DumpDocument - Run("L"this is a very long line of text"", 0) trace:richedit_lists:ME_DumpDocument - Run("L" "", 32) trace:richedit_lists:ME_DumpDocument - StartRow trace:richedit_lists:ME_DumpDocument - Run("L"that should be longer than one"", 33) trace:richedit_lists:ME_DumpDocument - Run("L" "", 63) trace:richedit_lists:ME_DumpDocument - StartRow trace:richedit_lists:ME_DumpDocument - Run("L"screen-width"", 64) trace:richedit_lists:ME_DumpDocument - Run("L"\00b6"", 76) trace:richedit_lists:ME_DumpDocument Paragraph(ofs=79) trace:richedit_lists:ME_DumpDocument - StartRow trace:richedit_lists:ME_DumpDocument - Run("L"c"", 0) trace:richedit_lists:ME_DumpDocument - Run("L"\00b6"", 1) trace:richedit_lists:ME_DumpDocument Paragraph(ofs=81) trace:richedit_lists:ME_DumpDocument - StartRow trace:richedit_lists:ME_DumpDocument - Run("L"d"", 0) trace:richedit_lists:ME_DumpDocument - Run("L"\00b6"", 1) trace:richedit_lists:ME_DumpDocument Paragraph(ofs=83) trace:richedit_lists:ME_DumpDocument - StartRow trace:richedit_lists:ME_DumpDocument - Run("L"e"", 0) trace:richedit_lists:ME_DumpDocument - Run("L"\00b6"", 1) trace:richedit_lists:ME_DumpDocument End(ofs=85) trace:richedit_lists:ME_DumpDocument DOCUMENT DUMP END