[This is preliminary documentation and subject to change.]
The PARAFORMAT2 structure contains information about paragraph formatting attributes in a rich edit control. PARAFORMAT2 is a rich edit 2.0 extension of the PARAFORMAT structure. Rich edit 2.0 allows you to use either structure with the EM_GETPARAFORMAT and EM_SETPARAFORMAT messages.
typedef struct _paraformat {
UINT cbSize;
_WPAD _wPad1;
DWORD dwMask;
WORD wNumbering;
WORD wReserved; // redefined as wEffects in PARAFORMAT2
LONG dxStartIndent;
LONG dxRightIndent;
LONG dxOffset;
WORD wAlignment;
SHORT cTabCount;
LONG rgxTabs[MAX_TAB_STOPS];
LONG dySpaceBefore; // vertical spacing before para
LONG dySpaceAfter; // vertical spacing after para
LONG dyLineSpacing; // line spacing depending on Rule
SHORT sStyle; // style handle
BYTE bLineSpacingRule; // rule for line spacing (see tom.doc)
BYTE bCRC; // reserved for CRC for rapid searching
WORD wShadingWeight; // shading in hundredths of a per cent
WORD wShadingStyle; // nibble 0: style, 1: cfpat, 2: cbpat
WORD wNumberingStart; // starting value for numbering
WORD wNumberingStyle; // alignment, roman/arabic, (), ), ., etc.
WORD wNumberingTab; // space bet 1st indent and 1st-line text
WORD wBorderSpace; // space between border and text (twips)
WORD wBorderWidth; // border pen width (twips)
WORD wBorders; // byte 0: bits specify which borders
// nibble 2: border style, 3: color index
} PARAFORMAT2;
#define wEffects wReserved
Set the following values to indicate the valid structure members.
Value | Meaning |
---|---|
PFM_ALIGNMENT | The wAlignment member is valid. |
PFM_BORDER | The wBorderSpace, wBorderWidth, and wBorders members are valid. |
PFM_LINESPACING | The dyLineSpacing and bLineSpacingRule members are valid. |
PFM_NUMBERING | The wNumbering member is valid. |
PFM_NUMBERINGSTART | The wNumberingStart member is valid. |
PFM_NUMBERINGSTYLE | The wNumberingStyle member is valid. |
PFM_NUMBERINGTAB | The wNumberingTab member is valid. |
PFM_OFFSET | The dxOffset member is valid. |
PFM_OFFSETINDENT | The dxStartIndent member is valid. If you are setting the indentation, dxStartIndent specifies the amount to indent relative to the current indentation. |
PFM_RIGHTINDENT | The dxRightIndent member is valid. |
PFM_SHADING | The wShadingWeight and wShadingStyle members are valid. |
PFM_SPACEAFTER | The dySpaceAfter member is valid. |
PFM_SPACEBEFORE | The dySpaceBefore member is valid. |
PFM_STARTINDENT | The dxStartIndent member is valid and specifies the indentation from the left margin. If both PFM_STARTINDENT and PFM_OFFSETINDENT are specified, PFM_STARTINDENT takes precedence. |
PFM_STYLE | The sStyle member is valid. |
PFM_TABSTOPS | The cTabCount and rgxTabs members are valid. |
Set the following values to indicate the valid attributes of the wEffects member.
Value | Meaning |
---|---|
PFM_DONOTHYPHEN | The PFE_DONOTHYPHEN value is valid. |
PFM_KEEP | The PFE_KEEP value is valid. |
PFM_KEEPNEXT | The PFE_KEEPNEXT value is valid. |
PFM_NOLINENUMBER | The PFE_NOLINENUMBER value is valid. |
PFM_NOWIDOWCONTROL | The PFE_NOWIDOWCONTROL value is valid. |
PFM_PAGEBREAKBEFORE | The PFE_PAGEBREAKBEFORE value is valid. |
PFM_RTLPARA | The PFE_RTLPARA value is valid. |
PFM_SIDEBYSIDE | The PFE_SIDEBYSIDE value is valid. |
PFM_TABLE | The PFE_TABLEROW, PFE_TABLECELLEND, and PFE_TABLECELL values are valid. |
Value | Meaning |
---|---|
zero | No paragraph numbering or bullets. |
PFN_BULLET | Insert a bullet at the beginning of each selected paragraph. |
Rich edit controls do not display paragraph numbers. However, for compatibility with Microsoft Text Object Model (TOM) interfaces, wNumbering can specify one of the following values; the rich edit control stores the value but does not use it to display the text.
Value | Meaning |
---|---|
2 | Use Arabic numbers (1, 2, 3, ...). |
3 | Use lowercase letters (a, b, c, ...). |
4 | Use uppercase letters (A, B, C, ...). |
5 | Use lowercase Roman numerals (i, ii, iii, ...). |
6 | Use uppercase Roman numerals (I, II, III, ...). |
7 | Use a sequence of characters beginning with the Unicode character specified by the wNumberingStart member. |
This member can be a combination of the following values.
Value | Meaning |
---|---|
PFE_DONOTHYPHEN | Disable automatic hyphenation. |
PFE_KEEP | No page break within the paragraph. |
PFE_KEEPNEXT | No page break between this paragraph and the next. |
PFE_NOLINENUMBER | Disable line numbering. |
PFE_NOWIDOWCONTROL | Disable widow/orphan control for this paragraph. |
PFE_PAGEBREAKBEFORE | Insert a page break before this paragraph. |
PFE_RTLPARA | Display text using right-to-left reading order. |
PFE_SIDEBYSIDE | Display paragraphs side-by-side. |
PFE_TABLECELL | The paragraph is in a table cell, but is not the last paragraph in the cell. |
PFE_TABLECELLEND | The paragraph is last in a table cell. |
PFE_TABLEROW | The paragraph describes a row in a table. |
Rich Edit 1.0: Reserved; must be zero.
If you are setting the indentation, use the PFM_STARTINDENT flag to specify an absolute indentation from the left margin; or use the PFM_OFFSETINDENT flag to specify an indentation relative to the paragraph's current indentation. Use either flag to retrieve the current indentation.
Value | Meaning |
---|---|
PFA_LEFT | Paragraphs are aligned with the left margin. |
PFA_RIGHT | Paragraphs are aligned with the right margin. |
PFA_CENTER | Paragraphs are centered. |
PFA_JUSTIFY | Rich Edit 2.0: Paragraphs are justified. This value is included for compatibility with TOM interfaces; rich edit controls display the text aligned with the left margin. |
Rich Edit 2.0: For compatibility with TOM interfaces, you can use the 8 high-order bits to store additional information about each tab stop. These bits do not affect the rich edit control display.
Bits 24-27 can specify one of the following values to indicate the tab alignment.
Value | Meaning |
---|---|
0 | Ordinary tab |
1 | Center tab |
2 | Right-aligned tab |
3 | Decimal tab |
4 | Word bar tab (vertical bar) |
Bits 28-31 can specify one of the following values to indicate the type of tab leader.
Value | Meaning |
---|---|
0 | No leader |
1 | Dotted leader |
2 | Dashed leader |
3 | Underlined leader |
4 | Thick line leader |
5 | Double line leader |
Value | Meaning |
---|---|
0 | Single spacing. The dyLineSpacing member is ignored. |
1 | One and a half spacing. The dyLineSpacing member is ignored. |
2 | Double spacing. The dyLineSpacing member is ignored. |
3 | The dyLineSpacing member specifies the spacing, in twips, from one line to the next. However, if dyLineSpacing specifies a value that is less than single spacing, the control displays single-spaced text. |
4 | The dyLineSpacing member specifies the spacing, in twips, from one line to the next. The control uses the exact spacing specified, even if dyLineSpacing specifies a value that is less than single spacing. |
5 | The value of dyLineSpacing / 20 is the spacing, in lines, from one line to the next. Thus, setting dyLineSpacing to 20 produces single-spaced text, 40 is double-spaced, 60 is triple-spaced, and so on. |
The shading style can be one of the following values.
Value | Meaning | Value | Meaning |
---|---|---|---|
0 | None | ||
1 | Dark horizontal | 7 | Light horizontal |
2 | Dark vertical | 8 | Light vertical |
3 | Dark down diagonal | 9 | Light down diagonal |
4 | Dark up diagonal | 10 | Light up diagonal |
5 | Dark grid | 11 | Light grid |
6 | Dark trellis | 12 | Light trellis |
The foreground and background color indexes can be one of the following values.
Value | Color | Value | Color |
---|---|---|---|
0 | Black | 8 | Dark blue |
1 | Blue | 9 | Dark cyan |
2 | Cyan | 10 | Dark green |
3 | Green | 11 | Dark magenta |
4 | Magenta | 12 | Dark red |
5 | Red | 13 | Dark yellow |
6 | Yellow | 14 | Dark gray |
7 | White | 15 | Light gray |
Value | Meaning |
---|---|
0 | Follow number with a right parenthesis. |
1 | Follow number with period. |
2 | Enclose number in parentheses. |
0x8000 | Force Roman numerals. |
Specify the border locations using a combination of the following values.
Value | Meaning |
---|---|
1 | Left border |
2 | Right border |
4 | Top border |
8 | Bottom border |
16 | Inside borders |
32 | Outside borders |
64 | Autocolor. If this bit is set, the color index in bits 12 to 15 is not used. |
Specify the border style using one of the following values.
Value | Style | Value | Style |
---|---|---|---|
0 | None | 6 | 6 point |
1 | ¾ point | 7 | ¾ point double |
2 | 1½ point | 8 | 1½ point double |
3 | 2¼ point | 9 | 2¼ point double |
4 | 3 point | 10 | ¾ point gray |
5 | 4½ point | 11 | ¾ point gray dashed |
Specify the border color using one of the following values. This value is ignored if the autocolor bit (bit 6) is set.
Value | Color | Value | Color |
---|---|---|---|
0 | Black | 8 | Dark blue |
1 | Blue | 9 | Dark cyan |
2 | Cyan | 10 | Dark green |
3 | Green | 11 | Dark magenta |
4 | Magenta | 12 | Dark red |
5 | Red | 13 | Dark yellow |
6 | Yellow | 14 | Dark gray |
7 | White | 15 | Light gray |
Windows NT: Requires version 4.0 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in richedit.h.
Rich Edit Controls Overview, Rich Edit Structures, EM_GETPARAFORMAT, EM_SETPARAFORMAT, PARAFORMAT