MSDN Home >  MSDN Library >  User Interface Design and Development >  Windows Controls >  Individual Control Information >  Rich Edit Controls > 

PARAFORMAT2 Structure


The PARAFORMAT2 structure contains information about paragraph formatting attributes in a rich edit control. PARAFORMAT2 is a Microsoft® 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.

Syntax

typedef struct _paraformat { 
    UINT cbSize; 
    DWORD dwMask; 
    WORD  wNumbering; 
    WORD  wEffects; 
    LONG  dxStartIndent; 
    LONG  dxRightIndent; 
    LONG  dxOffset; 
    WORD  wAlignment; 
    SHORT cTabCount; 
    LONG  rgxTabs[MAX_TAB_STOPS]; 
    LONG  dySpaceBefore; 
    LONG  dySpaceAfter; 
    LONG  dyLineSpacing; 
    SHORT sStyle; 
    BYTE  bLineSpacingRule; 
    BYTE  bOutlineLevel; 
    WORD  wShadingWeight; 
    WORD  wShadingStyle;
    WORD  wNumberingStart; 
    WORD  wNumberingStyle; 
    WORD  wNumberingTab; 
    WORD  wBorderSpace; 
    WORD  wBorderWidth; 
    WORD  wBorders; 
} PARAFORMAT2; 
#define  wEffects  wReserved

Members

cbSize
Structure size, in bytes. Before passing this structure to a rich edit control, set cbSize to the size of the PARAFORMAT or PARAFORMAT2 structure. If cbSize equals the size of a PARAFORMAT structure, the control uses only the PARAFORMAT members.
dwMask
The members of the PARAFORMAT2 structure that contain valid information. The dwMask member can be a combination of the values from two sets of bit flags. One set indicates the structure members that are valid; another set indicates the valid attributes in the wEffects member.

Set the following values to indicate the valid structure members.
ValueMeaning
PFM_ALIGNMENTThe wAlignment member is valid.
PFM_BORDERThe wBorderSpace, wBorderWidth, and wBorders members are valid.
PFM_LINESPACINGThe dyLineSpacing and bLineSpacingRule members are valid.
PFM_NUMBERINGThe wNumbering member is valid.
PFM_NUMBERINGSTARTThe wNumberingStart member is valid.
PFM_NUMBERINGSTYLEThe wNumberingStyle member is valid.
PFM_NUMBERINGTABThe wNumberingTab member is valid.
PFM_OFFSETThe dxOffset member is valid.
PFM_OFFSETINDENTThe dxStartIndent member is valid. If you are setting the indentation, dxStartIndent specifies the amount to indent relative to the current indentation.
PFM_RIGHTINDENTThe dxRightIndent member is valid.
PFM_SHADINGThe wShadingWeight and wShadingStyle members are valid.
PFM_SPACEAFTERThe dySpaceAfter member is valid.
PFM_SPACEBEFOREThe dySpaceBefore member is valid.
PFM_STARTINDENTThe 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_STYLEThe sStyle member is valid.
PFM_TABSTOPSThe cTabCount and rgxTabs members are valid.

 

Set the following values to indicate the valid attributes of the wEffects member.
ValueMeaning
PFM_DONOTHYPHENThe PFE_DONOTHYPHEN value is valid.
PFM_KEEPThe PFE_KEEP value is valid.
PFM_KEEPNEXTThe PFE_KEEPNEXT value is valid.
PFM_NOLINENUMBERThe PFE_NOLINENUMBER value is valid.
PFM_NOWIDOWCONTROLThe PFE_NOWIDOWCONTROL value is valid.
PFM_PAGEBREAKBEFOREThe PFE_PAGEBREAKBEFORE value is valid.
PFM_RTLPARAThe PFE_RTLPARA value is valid.
PFM_SIDEBYSIDEThe PFE_SIDEBYSIDE value is valid.
PFM_TABLEThe PFE_TABLE value is valid.

wNumbering
Options used for bulleted or numbered paragraphs. To use this member, set the PFM_NUMBERING flag in the dwMask member. This member can be one of the following values.

ValueMeaning
zeroNo paragraph numbering or bullets.
PFN_BULLETInsert a bullet at the beginning of each selected paragraph.
Rich Edit versions earlier than version 3.0 do not display paragraph numbers. However, for compatibility with Microsoft Text Object Model (TOM) interfaces, wNumbering can specify one of the following values.
ValueMeaning
2Uses Arabic numbers (1, 2, 3, ...).
3Uses lowercase letters (a, b, c, ...).
4Uses uppercase letters (A, B, C, ...).
5Uses lowercase Roman numerals (i, ii, iii, ...).
6Uses uppercase Roman numerals (I, II, III, ...).
7Uses a sequence of characters beginning with the Unicode character specified by the wNumberingStart member.

 

The rich edit control stores the value but does not use it to display the text.

wEffects
This member is also known as wReserved for Rich Edit 1.0 because it was reserved.

Rich Edit 1.0:  Reserved; the value must be zero.

Rich Edit 2.0: A set of bit flags that specify paragraph effects. These flags are included only for compatibility with Text Object Model (TOM) interfaces; the rich edit control stores the value but does not use it to display the text.

This member can be a combination of the following values.

PFE_DONOTHYPHEN
Disables automatic hyphenation.
PFE_KEEP
No page break within the paragraph.
PFE_KEEPNEXT
No page break between this paragraph and the next.
PFE_NOLINENUMBER
Disables line numbering (in Rich Edit 3.0 only).
PFE_NOWIDOWCONTROL
Disables widow and orphan control for the selected paragraph.
PFE_PAGEBREAKBEFORE
Inserts a page break before the selected paragraph.
PFE_RTLPARA
Displays text using right-to-left reading order (in Rich Edit 2.1 and later).
PFE_SIDEBYSIDE
Displays paragraphs side by side.
PFE_TABLE
The paragraph is a table row.
dxStartIndent
Indentation of the paragraph's first line, in twips. The indentation of subsequent lines depends on the dxOffset member. To use the dxStartIndent member, set the PFM_STARTINDENT or PFM_OFFSETINDENT flag in the dwMask member. 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.
dxRightIndent
Indentation of the right side of the paragraph, relative to the right margin, in twips. To use this member, set the PFM_RIGHTINDENT flag in the dwMask member.
dxOffset
Indentation of the second and subsequent lines, relative to the indentation of the first line, in twips. The first line is indented if this member is negative or outdented if this member is positive. To use this member, set the PFM_OFFSET flag in the dwMask member.
wAlignment
Paragraph alignment. To use this member, set the PFM_ALIGNMENT flag in the dwMask member. This member can be one of the following values.
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 earlier than Rich Edit 3.0 display the text aligned with the left margin.
PFA_FULL_INTERWORD
Paragraphs are justified by expanding the blanks alone.
cTabCount
Number of tab stops defined in the rgxTabs array.
rgxTabs
Array of absolute tab stop positions. Each element in the array specifies information about a tab stop. The 24 low-order bits specify the absolute offset, in twips. To use this member, set the PFM_TABSTOPS flag in the dwMask member.

Rich Edit 2.0: For compatibility with TOM interfaces, you can use the eight high-order bits to store additional information about each tab stop.

Bits 28-31 can specify one of the following values to indicate the type of tab leader. These bits do not affect the rich edit control display.
ValueMeaning
0No leader
1Dotted leader
2Dashed leader
3Underlined leader
4Thick line leader
5Double line leader

Bits 24-27 can specify one of the following values to indicate the tab alignment. These bits do not affect the rich edit control display for versions earlier than Rich Edit 3.0.

0
Ordinary tab
1
Center tab
2
Right-aligned tab
3
Decimal tab
4
Word bar tab (vertical bar)
dySpaceBefore
Size of the spacing above the paragraph, in twips. To use this member, set the PFM_SPACEBEFORE flag in the dwMask member. The value must be greater than or equal to zero.
dySpaceAfter
Specifies the size of the spacing below the paragraph, in twips. To use this member, set the PFM_SPACEAFTER flag in the dwMask member. The value must be greater than or equal to zero.
dyLineSpacing
Spacing between lines. For a description of how this value is interpreted, see the bLineSpacingRule member. To use this member, set the PFM_LINESPACING flag in the dwMask member.
sStyle
Text style. To use this member, set the PFM_STYLE flag in the dwMask member. This member is included only for compatibility with TOM interfaces and Microsoft Word; the rich edit control stores the value but does not use it to display the text.
bLineSpacingRule
Type of line spacing. To use this member, set the PFM_SPACEAFTER flag in the dwMask member. This member can be one of the following values.
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 spacingfrom one line to the next, in twips. 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 from one line to the next, in twips. 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.
bOutlineLevel
Reserved; must be zero.
wShadingWeight
Percentage foreground color used in shading. The wShadingStyle member specifies the foreground and background shading colors. A value of 5 indicates a shading color consisting of 5 percent foreground color and 95 percent background color. To use these members, set the PFM_SHADING flag in the dwMask member. This member is included only for compatibility with Word; the rich edit control stores the value but does not use it to display the text.
wShadingStyle
Style and colors used for background shading. Bits 0 to 3 contain the shading style, bits 4 to 7 contain the foreground color index, and bits 8 to 11 contain the background color index. To use this member, set the PFM_SHADING flag in the dwMask member. This member is included only for compatibility with Word; the rich edit control stores the value but does not use it to display the text.

The foreground and background color indexes can be one of the following values.

ValueColorValueColor
0Black8Dark blue
1Blue9Dark cyan
2Cyan10Dark green
3Green11Dark magenta
4Magenta12Dark red
5Red13Dark yellow
6Yellow14Dark gray
7White15Light gray

The shading style can be one of the following values.

0
None
1
Dark horizontal
2
Dark vertical
3
Dark down diagonal
4
Dark up diagonal
5
Dark grid
6
Dark trellis
7
Light horizontal
8
Light vertical
9
Light down diagonal
10
Light up diagonal
11
Light grid
12
Light trellis
wNumberingStart
Starting number or Unicode value used for numbered paragraphs. Use this member in conjunction with the wNumbering member. This member is included only for compatibility with TOM interfaces; the rich edit control stores the value but does not use it to display the text or bullets. To use this member, set the PFM_NUMBERINGSTART flag in the dwMask member.
wNumberingStyle
Numbering style used with numbered paragraphs. Use this member in conjunction with the wNumbering member. This member is included only for compatibility with TOM interfaces; the rich edit control stores the value but rich edit versions earlier than 3.0 do not use it to display the text or bullets. To use this member, set the PFM_NUMBERINGSTYLE flag in the dwMask member. This member can be one of the following values.
0
Follows the number with a right parenthesis.
0x100
Encloses the number in parentheses.
0x200
Follows the number with a period.
0x300
Displays only the number.
0x400
Continues a numbered list without applying the next number or bullet.
0x8000
Starts a new number with wNumberingStart.
wNumberingTab
Minimum space between a paragraph number and the paragraph text, in twips. Use this member in conjunction with the wNumbering member. The wNumberingTabmember is included for compatibility with TOM interfaces; previous to Rich Edit 3.0, the rich edit control stores the value but does not use it to display text. To use this member, set the PFM_NUMBERINGTAB flag in the dwMask member.
wBorderSpace
The space between the border and the paragraph text, in twips. The wBorderSpace member is included for compatibility with Word; the rich edit control stores the values but does not use them to display text. To use this member, set the PFM_BORDER flag in the dwMask member.
wBorderWidth
Border width, in twips. To use this member, set the PFM_BORDER flag in the dwMask member.
wBorders
dwMask member.  

Specify the border style using one of the following values. Windows 95 with Rich Edit 2.0 , Windows 98, Windows NT 4.0

See Also

Rich Edit Controls, EM_GETPARAFORMAT, EM_SETPARAFORMAT, PARAFORMAT
 Contact Us   |  E-Mail this Page   |  MSDN Flash Newsletter
 c 2002 Microsoft Corporation. All rights reserved.   Terms of Use  Privacy Statement   Accessibility