home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / richedit.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  32KB  |  1,078 lines

  1. /*
  2.  *    RICHEDIT.H
  3.  *    
  4.  *    Purpose:
  5.  *        RICHEDIT v2.0 public definitions.  Note that there is additional
  6.  *        functionality available for v2.0 that is not in the original
  7.  *        Windows 95 release.
  8.  *    
  9.  *    Copyright (c) 1985-1996, Microsoft Corporation
  10.  */
  11.  
  12. #ifndef _RICHEDIT_
  13. #define    _RICHEDIT_
  14.  
  15. #ifdef _WIN32
  16. #include <pshpack4.h>
  17. #elif !defined(RC_INVOKED)
  18. #pragma pack(4)
  19. #endif
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif /* __cplusplus */
  24.  
  25. /* To mimic older RichEdit behavior, simply set _RICHEDIT_VER to the appropriate value */
  26. /*        Version 1.0        0x0100    */
  27. /*        Version 2.0        0x0200    */
  28. #ifndef _RICHEDIT_VER
  29. #define _RICHEDIT_VER    0x0210
  30. #endif
  31.  
  32. /*
  33.  *    To make some structures which can be passed between 16 and 32 bit windows
  34.  *    almost compatible, padding is introduced to the 16 bit versions of the
  35.  *    structure.
  36.  */
  37. #ifdef _WIN32
  38. #    define    _WPAD    /##/
  39. #else
  40. #    define    _WPAD    WORD
  41. #endif
  42.  
  43. #define cchTextLimitDefault 32767
  44.  
  45. /* Richedit2.0 Window Class. */
  46.  
  47. #define RICHEDIT_CLASSA        "RichEdit20A"
  48. #define RICHEDIT_CLASS10A    "RICHEDIT"            // Richedit 1.0
  49.  
  50. #ifndef MACPORT
  51. #define RICHEDIT_CLASSW        L"RichEdit20W"
  52. #else    /*----------------------MACPORT */
  53. #define RICHEDIT_CLASSW        TEXT("RichEdit20W")    /* MACPORT change */
  54. #endif /* MACPORT  */
  55.  
  56. #if (_RICHEDIT_VER >= 0x0200 )
  57. #ifdef UNICODE
  58. #define RICHEDIT_CLASS        RICHEDIT_CLASSW
  59. #else
  60. #define RICHEDIT_CLASS        RICHEDIT_CLASSA
  61. #endif /* UNICODE */
  62. #else
  63. #define RICHEDIT_CLASS        RICHEDIT_CLASS10A
  64. #endif /* _RICHEDIT_VER >= 0x0200 */
  65.  
  66. /* RichEdit messages */
  67.  
  68. #ifndef WM_CONTEXTMENU
  69. #define WM_CONTEXTMENU            0x007B
  70. #endif
  71.  
  72. #ifndef WM_PRINTCLIENT
  73. #define WM_PRINTCLIENT            0x0318
  74. #endif
  75.  
  76. #ifndef EM_GETLIMITTEXT
  77. #define EM_GETLIMITTEXT            (WM_USER + 37)
  78. #endif
  79.  
  80. #ifndef EM_POSFROMCHAR    
  81. #define EM_POSFROMCHAR            (WM_USER + 38)
  82. #define EM_CHARFROMPOS            (WM_USER + 39)
  83. #endif
  84.  
  85. #ifndef EM_SCROLLCARET
  86. #define EM_SCROLLCARET            (WM_USER + 49)
  87. #endif
  88. #define EM_CANPASTE                (WM_USER + 50)
  89. #define EM_DISPLAYBAND            (WM_USER + 51)
  90. #define EM_EXGETSEL                (WM_USER + 52)
  91. #define EM_EXLIMITTEXT            (WM_USER + 53)
  92. #define EM_EXLINEFROMCHAR        (WM_USER + 54)
  93. #define EM_EXSETSEL                (WM_USER + 55)
  94. #define EM_FINDTEXT                (WM_USER + 56)
  95. #define EM_FORMATRANGE            (WM_USER + 57)
  96. #define EM_GETCHARFORMAT        (WM_USER + 58)
  97. #define EM_GETEVENTMASK            (WM_USER + 59)
  98. #define EM_GETOLEINTERFACE        (WM_USER + 60)
  99. #define EM_GETPARAFORMAT        (WM_USER + 61)
  100. #define EM_GETSELTEXT            (WM_USER + 62)
  101. #define EM_HIDESELECTION        (WM_USER + 63)
  102. #define EM_PASTESPECIAL            (WM_USER + 64)
  103. #define EM_REQUESTRESIZE        (WM_USER + 65)
  104. #define EM_SELECTIONTYPE        (WM_USER + 66)
  105. #define EM_SETBKGNDCOLOR        (WM_USER + 67)
  106. #define EM_SETCHARFORMAT        (WM_USER + 68)
  107. #define EM_SETEVENTMASK            (WM_USER + 69)
  108. #define EM_SETOLECALLBACK        (WM_USER + 70)
  109. #define EM_SETPARAFORMAT        (WM_USER + 71)
  110. #define EM_SETTARGETDEVICE        (WM_USER + 72)
  111. #define EM_STREAMIN                (WM_USER + 73)
  112. #define EM_STREAMOUT            (WM_USER + 74)
  113. #define EM_GETTEXTRANGE            (WM_USER + 75)
  114. #define EM_FINDWORDBREAK        (WM_USER + 76)
  115. #define EM_SETOPTIONS            (WM_USER + 77)
  116. #define EM_GETOPTIONS            (WM_USER + 78)
  117. #define EM_FINDTEXTEX            (WM_USER + 79)
  118. #ifdef _WIN32
  119. #define EM_GETWORDBREAKPROCEX    (WM_USER + 80)
  120. #define EM_SETWORDBREAKPROCEX    (WM_USER + 81)
  121. #endif
  122.  
  123. /* Richedit v2.0 messages */
  124. #define    EM_SETUNDOLIMIT            (WM_USER + 82)
  125. #define EM_REDO                    (WM_USER + 84)
  126. #define EM_CANREDO                (WM_USER + 85)
  127. #define EM_GETUNDONAME            (WM_USER + 86)
  128. #define EM_GETREDONAME            (WM_USER + 87)
  129. #define EM_STOPGROUPTYPING        (WM_USER + 88)
  130.  
  131. #define EM_SETTEXTMODE            (WM_USER + 89)
  132. #define EM_GETTEXTMODE            (WM_USER + 90)
  133.  
  134. /* enum for use with EM_GET/SETTEXTMODE */
  135. typedef enum tagTextMode
  136. {
  137.     TM_PLAINTEXT            = 1,
  138.     TM_RICHTEXT                = 2,    /* default behavior */
  139.     TM_SINGLELEVELUNDO        = 4,
  140.     TM_MULTILEVELUNDO        = 8,    /* default behavior */
  141.     TM_SINGLECODEPAGE        = 16,
  142.     TM_MULTICODEPAGE        = 32    /* default behavior */
  143. } TEXTMODE;
  144.  
  145. #define EM_AUTOURLDETECT        (WM_USER + 91)
  146. #define EM_GETAUTOURLDETECT        (WM_USER + 92)
  147. #define EM_SETPALETTE            (WM_USER + 93)
  148. #define EM_GETTEXTEX            (WM_USER + 94)
  149. #define EM_GETTEXTLENGTHEX        (WM_USER + 95)
  150.  
  151. /* Far East specific messages */
  152. #define EM_SETPUNCTUATION        (WM_USER + 100)
  153. #define EM_GETPUNCTUATION        (WM_USER + 101)
  154. #define EM_SETWORDWRAPMODE        (WM_USER + 102)
  155. #define EM_GETWORDWRAPMODE        (WM_USER + 103)
  156. #define EM_SETIMECOLOR            (WM_USER + 104)
  157. #define EM_GETIMECOLOR            (WM_USER + 105)
  158. #define EM_SETIMEOPTIONS        (WM_USER + 106)
  159. #define EM_GETIMEOPTIONS        (WM_USER + 107)
  160. #define EM_CONVPOSITION         (WM_USER + 108)
  161.  
  162. #define EM_SETLANGOPTIONS        (WM_USER + 120)
  163. #define EM_GETLANGOPTIONS        (WM_USER + 121)
  164. #define EM_GETIMECOMPMODE        (WM_USER + 122)
  165.  
  166. #define EM_FINDTEXTW            (WM_USER + 123)
  167. #define EM_FINDTEXTEXW            (WM_USER + 124)
  168.  
  169. /* BiDi specific messages */
  170. #define EM_SETBIDIOPTIONS        (WM_USER + 200)
  171. #define EM_GETBIDIOPTIONS        (WM_USER + 201)
  172.  
  173. /* Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS */
  174. #define IMF_AUTOKEYBOARD        0x0001
  175. #define IMF_AUTOFONT            0x0002
  176. #define IMF_IMECANCELCOMPLETE    0x0004    // high completes the comp string when aborting, low cancels.
  177. #define IMF_IMEALWAYSSENDNOTIFY 0x0008
  178.  
  179. /* Values for EM_GETIMECOMPMODE */
  180. #define ICM_NOTOPEN                0x0000
  181. #define ICM_LEVEL3                0x0001
  182. #define ICM_LEVEL2                0x0002
  183. #define ICM_LEVEL2_5            0x0003
  184. #define ICM_LEVEL2_SUI            0x0004
  185.  
  186. /* New notifications */
  187.  
  188. #define EN_MSGFILTER            0x0700
  189. #define EN_REQUESTRESIZE        0x0701
  190. #define EN_SELCHANGE            0x0702
  191. #define EN_DROPFILES            0x0703
  192. #define EN_PROTECTED            0x0704
  193. #define EN_CORRECTTEXT            0x0705            /* PenWin specific */
  194. #define EN_STOPNOUNDO            0x0706
  195. #define EN_IMECHANGE            0x0707            /* Far East specific */
  196. #define EN_SAVECLIPBOARD        0x0708
  197. #define EN_OLEOPFAILED            0x0709
  198. #define EN_OBJECTPOSITIONS        0x070a
  199. #define EN_LINK                    0x070b
  200. #define EN_DRAGDROPDONE            0x070c
  201.  
  202. /* BiDi specific notifications */
  203.  
  204. #define EN_ALIGN_LTR            0x0710
  205. #define EN_ALIGN_RTL            0x0711
  206.  
  207. /* Event notification masks */
  208.  
  209. #define ENM_NONE                0x00000000
  210. #define ENM_CHANGE                0x00000001
  211. #define ENM_UPDATE                0x00000002
  212. #define ENM_SCROLL                0x00000004
  213. #define ENM_KEYEVENTS            0x00010000
  214. #define ENM_MOUSEEVENTS            0x00020000
  215. #define ENM_REQUESTRESIZE        0x00040000
  216. #define ENM_SELCHANGE            0x00080000
  217. #define ENM_DROPFILES            0x00100000
  218. #define ENM_PROTECTED            0x00200000
  219. #define ENM_CORRECTTEXT            0x00400000        /* PenWin specific */
  220. #define ENM_SCROLLEVENTS        0x00000008
  221. #define ENM_DRAGDROPDONE        0x00000010
  222.  
  223. /* Far East specific notification mask */
  224. #define ENM_IMECHANGE            0x00800000        /* unused by RE2.0 */
  225. #define ENM_LANGCHANGE            0x01000000
  226. #define ENM_OBJECTPOSITIONS        0x02000000
  227. #define ENM_LINK                0x04000000
  228.  
  229. /* New edit control styles */
  230.  
  231. #define ES_SAVESEL                0x00008000
  232. #define ES_SUNKEN                0x00004000
  233. #define ES_DISABLENOSCROLL        0x00002000
  234. /* same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value */
  235. #define ES_SELECTIONBAR            0x01000000
  236. /* same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop */
  237. #define ES_NOOLEDRAGDROP        0x00000008
  238.  
  239. /* New edit control extended style */
  240. #ifdef    _WIN32
  241. #define ES_EX_NOCALLOLEINIT        0x01000000
  242. #endif    
  243.  
  244. /* These flags are used in FE Windows */
  245. #define ES_VERTICAL                0x00400000
  246. #define    ES_NOIME                0x00080000
  247. #define ES_SELFIME                0x00040000
  248.  
  249. /* Edit control options */
  250. #define ECO_AUTOWORDSELECTION    0x00000001
  251. #define ECO_AUTOVSCROLL            0x00000040
  252. #define ECO_AUTOHSCROLL            0x00000080
  253. #define ECO_NOHIDESEL            0x00000100
  254. #define ECO_READONLY            0x00000800
  255. #define ECO_WANTRETURN            0x00001000
  256. #define ECO_SAVESEL                0x00008000
  257. #define ECO_SELECTIONBAR        0x01000000
  258. #define ECO_VERTICAL            0x00400000        /* FE specific */
  259.  
  260.  
  261. /* ECO operations */
  262. #define ECOOP_SET                0x0001
  263. #define ECOOP_OR                0x0002
  264. #define ECOOP_AND                0x0003
  265. #define ECOOP_XOR                0x0004
  266.  
  267. /* new word break function actions */
  268. #define WB_CLASSIFY            3
  269. #define WB_MOVEWORDLEFT        4
  270. #define WB_MOVEWORDRIGHT    5
  271. #define WB_LEFTBREAK        6
  272. #define WB_RIGHTBREAK        7
  273.  
  274. /* Far East specific flags */
  275. #define WB_MOVEWORDPREV        4
  276. #define WB_MOVEWORDNEXT        5
  277. #define WB_PREVBREAK        6
  278. #define WB_NEXTBREAK        7
  279.  
  280. #define PC_FOLLOWING        1
  281. #define    PC_LEADING            2
  282. #define    PC_OVERFLOW            3
  283. #define    PC_DELIMITER        4
  284. #define WBF_WORDWRAP        0x010
  285. #define WBF_WORDBREAK        0x020
  286. #define    WBF_OVERFLOW        0x040    
  287. #define WBF_LEVEL1            0x080
  288. #define    WBF_LEVEL2            0x100
  289. #define    WBF_CUSTOM            0x200
  290.  
  291. /* Far East specific flags */
  292. #define IMF_FORCENONE           0x0001
  293. #define IMF_FORCEENABLE         0x0002
  294. #define IMF_FORCEDISABLE        0x0004
  295. #define IMF_CLOSESTATUSWINDOW   0x0008
  296. #define IMF_VERTICAL            0x0020
  297. #define IMF_FORCEACTIVE         0x0040
  298. #define IMF_FORCEINACTIVE       0x0080
  299. #define IMF_FORCEREMEMBER       0x0100
  300. #define IMF_MULTIPLEEDIT        0x0400
  301.  
  302. /* Word break flags (used with WB_CLASSIFY) */
  303. #define WBF_CLASS            ((BYTE) 0x0F)
  304. #define WBF_ISWHITE            ((BYTE) 0x10)
  305. #define WBF_BREAKLINE        ((BYTE) 0x20)
  306. #define WBF_BREAKAFTER        ((BYTE) 0x40)
  307.  
  308.  
  309. /* new data types */
  310.  
  311. #ifdef _WIN32
  312. /* extended edit word break proc (character set aware) */
  313. typedef LONG (*EDITWORDBREAKPROCEX)(char *pchText, LONG cchText, BYTE bCharSet, INT action);
  314. #endif
  315.  
  316. /* all character format measurements are in twips */
  317. typedef struct _charformat
  318. {
  319.     UINT        cbSize;
  320.     _WPAD        _wPad1;
  321.     DWORD        dwMask;
  322.     DWORD        dwEffects;
  323.     LONG        yHeight;
  324.     LONG        yOffset;
  325.     COLORREF    crTextColor;
  326.     BYTE        bCharSet;
  327.     BYTE        bPitchAndFamily;
  328.     char        szFaceName[LF_FACESIZE];
  329.     _WPAD        _wPad2;
  330. } CHARFORMATA;
  331.  
  332. typedef struct _charformatw
  333. {
  334.     UINT        cbSize;
  335.     _WPAD        _wPad1;
  336.     DWORD        dwMask;
  337.     DWORD        dwEffects;
  338.     LONG        yHeight;
  339.     LONG        yOffset;
  340.     COLORREF    crTextColor;
  341.     BYTE        bCharSet;
  342.     BYTE        bPitchAndFamily;
  343.     WCHAR        szFaceName[LF_FACESIZE];
  344.     _WPAD        _wPad2;
  345. } CHARFORMATW;
  346.  
  347. #if (_RICHEDIT_VER >= 0x0200)
  348. #ifdef UNICODE
  349. #define CHARFORMAT CHARFORMATW
  350. #else
  351. #define CHARFORMAT CHARFORMATA
  352. #endif /* UNICODE */
  353. #else
  354. #define CHARFORMAT CHARFORMATA
  355. #endif /* _RICHEDIT_VER >= 0x0200 */
  356.  
  357. /* CHARFORMAT masks */
  358. #define CFM_BOLD        0x00000001
  359. #define CFM_ITALIC        0x00000002
  360. #define CFM_UNDERLINE    0x00000004
  361. #define CFM_STRIKEOUT    0x00000008
  362. #define CFM_PROTECTED    0x00000010
  363. #define CFM_LINK        0x00000020        /* Exchange hyperlink extension */
  364. #define CFM_SIZE        0x80000000
  365. #define CFM_COLOR        0x40000000
  366. #define CFM_FACE        0x20000000
  367. #define CFM_OFFSET        0x10000000
  368. #define CFM_CHARSET        0x08000000
  369.  
  370. /* CHARFORMAT effects */
  371. #define CFE_BOLD        0x0001
  372. #define CFE_ITALIC        0x0002
  373. #define CFE_UNDERLINE    0x0004
  374. #define CFE_STRIKEOUT    0x0008
  375. #define CFE_PROTECTED    0x0010
  376. #define CFE_LINK        0x0020
  377. #define CFE_AUTOCOLOR    0x40000000        /* NOTE: this corresponds to */
  378.                                         /* CFM_COLOR, which controls it */
  379. #define yHeightCharPtsMost 1638
  380.  
  381. /* EM_SETCHARFORMAT wParam masks */
  382. #define SCF_SELECTION    0x0001
  383. #define SCF_WORD        0x0002
  384. #define SCF_DEFAULT        0x0000        // set the default charformat or paraformat
  385. #define SCF_ALL            0x0004        // not valid with SCF_SELECTION or SCF_WORD
  386. #define SCF_USEUIRULES    0x0008        // modifier for SCF_SELECTION; says that
  387.                                     // the format came from a toolbar, etc. and
  388.                                     // therefore UI formatting rules should be
  389.                                     // used instead of strictly formatting the
  390.                                     // selection.
  391.  
  392.  
  393. typedef struct _charrange
  394. {
  395.     LONG    cpMin;
  396.     LONG    cpMax;
  397. } CHARRANGE;
  398.  
  399. typedef struct _textrange
  400. {
  401.     CHARRANGE chrg;
  402.     LPSTR lpstrText;    /* allocated by caller, zero terminated by RichEdit */
  403. } TEXTRANGEA;
  404.  
  405. typedef struct _textrangew
  406. {
  407.     CHARRANGE chrg;
  408.     LPWSTR lpstrText;    /* allocated by caller, zero terminated by RichEdit */
  409. } TEXTRANGEW;
  410.  
  411. #if (_RICHEDIT_VER >= 0x0200)
  412. #ifdef UNICODE
  413. #define TEXTRANGE     TEXTRANGEW
  414. #else
  415. #define TEXTRANGE    TEXTRANGEA
  416. #endif /* UNICODE */
  417. #else
  418. #define TEXTRANGE    TEXTRANGEA
  419. #endif /* _RICHEDIT_VER >= 0x0200 */
  420.  
  421.  
  422. typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
  423.  
  424. typedef struct _editstream
  425. {
  426.     DWORD dwCookie;        /* user value passed to callback as first parameter */
  427.     DWORD dwError;        /* last error */
  428.     EDITSTREAMCALLBACK pfnCallback;
  429. } EDITSTREAM;
  430.  
  431. /* stream formats */
  432.  
  433. #define SF_TEXT            0x0001
  434. #define SF_RTF            0x0002
  435. #define SF_RTFNOOBJS    0x0003        /* outbound only */
  436. #define SF_TEXTIZED        0x0004        /* outbound only */
  437. #define SF_UNICODE        0x0010        /* Unicode file of some kind */
  438.  
  439. /* Flag telling stream operations to operate on the selection only */
  440. /* EM_STREAMIN will replace the current selection */
  441. /* EM_STREAMOUT will stream out the current selection */
  442. #define SFF_SELECTION    0x8000
  443.  
  444. /* Flag telling stream operations to operate on the common RTF keyword only */
  445. /* EM_STREAMIN will accept the only common RTF keyword */
  446. /* EM_STREAMOUT will stream out the only common RTF keyword */
  447. #define SFF_PLAINRTF    0x4000
  448.  
  449. typedef struct _findtext
  450. {
  451.     CHARRANGE chrg;
  452.     LPSTR lpstrText;
  453. } FINDTEXTA;
  454.  
  455. typedef struct _findtextw
  456. {
  457.     CHARRANGE chrg;
  458.     LPWSTR lpstrText;
  459. } FINDTEXTW;
  460.  
  461. #if (_RICHEDIT_VER >= 0x0200)
  462. #ifdef UNICODE
  463. #define FINDTEXT    FINDTEXTW
  464. #else
  465. #define FINDTEXT    FINDTEXTA
  466. #endif /* UNICODE */
  467. #else
  468. #define FINDTEXT    FINDTEXTA
  469. #endif /* _RICHEDIT_VER >= 0x0200 */
  470.  
  471. typedef struct _findtextexa
  472. {
  473.     CHARRANGE chrg;
  474.     LPSTR lpstrText;
  475.     CHARRANGE chrgText;
  476. } FINDTEXTEXA;
  477.  
  478. typedef struct _findtextexw
  479. {
  480.     CHARRANGE chrg;
  481.     LPWSTR lpstrText;
  482.     CHARRANGE chrgText;
  483. } FINDTEXTEXW;
  484.  
  485. #if (_RICHEDIT_VER >= 0x0200)
  486. #ifdef UNICODE
  487. #define FINDTEXTEX    FINDTEXTEXW
  488. #else
  489. #define FINDTEXTEX    FINDTEXTEXA
  490. #endif /* UNICODE */
  491. #else
  492. #define FINDTEXTEX    FINDTEXTEXA
  493. #endif /* _RICHEDIT_VER >= 0x0200 */
  494.  
  495.  
  496. typedef struct _formatrange
  497. {
  498.     HDC hdc;
  499.     HDC hdcTarget;
  500.     RECT rc;
  501.     RECT rcPage;
  502.     CHARRANGE chrg;
  503. } FORMATRANGE;
  504.  
  505. /* all paragraph measurements are in twips */
  506.  
  507. #define MAX_TAB_STOPS 32
  508. #define lDefaultTab 720
  509.  
  510. typedef struct _paraformat
  511. {
  512.     UINT    cbSize;
  513.     _WPAD    _wPad1;
  514.     DWORD    dwMask;
  515.     WORD    wNumbering;
  516. #if (_RICHEDIT_VER >= 0x0210)
  517.     WORD    wEffects;
  518. #else
  519.     WORD    wReserved;
  520. #endif /* _RICHEDIT_VER >= 0x0210 */
  521.     LONG    dxStartIndent;
  522.     LONG    dxRightIndent;
  523.     LONG    dxOffset;
  524.     WORD    wAlignment;
  525.     SHORT    cTabCount;
  526.     LONG    rgxTabs[MAX_TAB_STOPS];
  527. } PARAFORMAT;
  528.  
  529. /* PARAFORMAT mask values */
  530. #define PFM_STARTINDENT            0x00000001
  531. #define PFM_RIGHTINDENT            0x00000002
  532. #define PFM_OFFSET                0x00000004
  533. #define PFM_ALIGNMENT            0x00000008
  534. #define PFM_TABSTOPS            0x00000010
  535. #define PFM_NUMBERING            0x00000020
  536. #define PFM_OFFSETINDENT        0x80000000
  537.  
  538. /* PARAFORMAT numbering options */
  539. #define PFN_BULLET        0x0001
  540.  
  541. /* PARAFORMAT alignment options */
  542. #define PFA_LEFT    0x0001
  543. #define PFA_RIGHT    0x0002
  544. #define PFA_CENTER    0x0003
  545.  
  546. /* CHARFORMAT2 and PARAFORMAT2 structures */
  547.  
  548. #ifdef __cplusplus
  549.  
  550. struct CHARFORMAT2W : _charformatw
  551. {
  552.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  553.     SHORT        sSpacing;            /* Amount to space between letters    */
  554.     COLORREF    crBackColor;        /* Background color                    */
  555.     LCID        lcid;                /* Locale ID                        */
  556.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  557.     SHORT        sStyle;                /* Style handle                        */
  558.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  559.     BYTE        bUnderlineType;        /* Underline type                    */
  560.     BYTE        bAnimation;            /* Animated text like marching ants */
  561.     BYTE        bRevAuthor;            /* Revision author index            */
  562. };
  563.  
  564. struct CHARFORMAT2A : _charformat
  565. {
  566.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  567.     SHORT        sSpacing;            /* Amount to space between letters    */
  568.     COLORREF    crBackColor;        /* Background color                    */
  569.     LCID        lcid;                /* Locale ID                        */
  570.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  571.     SHORT        sStyle;                /* Style handle                        */
  572.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  573.     BYTE        bUnderlineType;        /* Underline type                    */
  574.     BYTE        bAnimation;            /* Animated text like marching ants    */
  575.     BYTE        bRevAuthor;            /* Revision author index            */
  576. };
  577.  
  578. #else    /* regular C-style  */
  579.  
  580. typedef struct _charformat2w
  581. {
  582.     UINT        cbSize;
  583.     _WPAD        _wPad1;
  584.     DWORD        dwMask;
  585.     DWORD        dwEffects;
  586.     LONG        yHeight;
  587.     LONG        yOffset;            /* > 0 for superscript, < 0 for subscript */
  588.     COLORREF    crTextColor;
  589.     BYTE        bCharSet;
  590.     BYTE        bPitchAndFamily;
  591.     WCHAR        szFaceName[LF_FACESIZE];
  592.     _WPAD        _wPad2;
  593.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  594.     SHORT        sSpacing;            /* Amount to space between letters    */
  595.     COLORREF    crBackColor;        /* Background color                    */
  596.     LCID        lcid;                /* Locale ID                        */
  597.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  598.     SHORT        sStyle;                /* Style handle                        */
  599.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  600.     BYTE        bUnderlineType;        /* Underline type                    */
  601.     BYTE        bAnimation;            /* Animated text like marching ants    */
  602.     BYTE        bRevAuthor;            /* Revision author index            */
  603.     BYTE        bReserved1;
  604. } CHARFORMAT2W;
  605.  
  606. typedef struct _charformat2a
  607. {
  608.     UINT        cbSize;
  609.     _WPAD        _wPad1;
  610.     DWORD        dwMask;
  611.     DWORD        dwEffects;
  612.     LONG        yHeight;
  613.     LONG        yOffset;            /* > 0 for superscript, < 0 for subscript */
  614.     COLORREF    crTextColor;
  615.     BYTE        bCharSet;
  616.     BYTE        bPitchAndFamily;
  617.     char        szFaceName[LF_FACESIZE];
  618.     _WPAD        _wPad2;
  619.     WORD        wWeight;            /* Font weight (LOGFONT value)        */
  620.     SHORT        sSpacing;            /* Amount to space between letters    */
  621.     COLORREF    crBackColor;        /* Background color                    */
  622.     LCID        lcid;                /* Locale ID                        */
  623.     DWORD        dwReserved;            /* Reserved. Must be 0                */
  624.     SHORT        sStyle;                /* Style handle                        */
  625.     WORD        wKerning;            /* Twip size above which to kern char pair*/
  626.     BYTE        bUnderlineType;        /* Underline type                    */
  627.     BYTE        bAnimation;            /* Animated text like marching ants    */
  628.     BYTE        bRevAuthor;            /* Revision author index            */
  629. } CHARFORMAT2A;
  630.  
  631. #endif /* C++ */
  632.  
  633. #ifdef UNICODE
  634. #define CHARFORMAT2    CHARFORMAT2W
  635. #else
  636. #define CHARFORMAT2 CHARFORMAT2A
  637. #endif
  638.  
  639. #define CHARFORMATDELTA        (sizeof(CHARFORMAT2) - sizeof(CHARFORMAT))
  640.  
  641.  
  642. /* CHARFORMAT and PARAFORMAT "ALL" masks
  643.    CFM_COLOR mirrors CFE_AUTOCOLOR, a little hack to easily deal with autocolor*/
  644.  
  645. #define CFM_EFFECTS (CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | \
  646.                      CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK)
  647. #define CFM_ALL (CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET)
  648.  
  649. #define    PFM_ALL (PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET    | \
  650.                  PFM_ALIGNMENT   | PFM_TABSTOPS    | PFM_NUMBERING | \
  651.                  PFM_OFFSETINDENT| PFM_DIR)
  652.  
  653. /* New masks and effects -- a parenthesized asterisk indicates that
  654.    the data is stored by RichEdit2.0, but not displayed */
  655.  
  656. #define CFM_SMALLCAPS        0x0040            /* (*)    */
  657. #define    CFM_ALLCAPS            0x0080            /* (*)    */
  658. #define    CFM_HIDDEN            0x0100            /* (*)    */
  659. #define    CFM_OUTLINE            0x0200            /* (*)    */
  660. #define    CFM_SHADOW            0x0400            /* (*)    */
  661. #define    CFM_EMBOSS            0x0800            /* (*)    */
  662. #define    CFM_IMPRINT            0x1000            /* (*)    */
  663. #define CFM_DISABLED        0x2000
  664. #define    CFM_REVISED            0x4000
  665.  
  666. #define CFM_BACKCOLOR        0x04000000
  667. #define CFM_LCID            0x02000000
  668. #define    CFM_UNDERLINETYPE    0x00800000        /* (*)    */
  669. #define    CFM_WEIGHT            0x00400000
  670. #define CFM_SPACING            0x00200000        /* (*)    */
  671. #define CFM_KERNING            0x00100000        /* (*)    */
  672. #define CFM_STYLE            0x00080000        /* (*)    */
  673. #define CFM_ANIMATION        0x00040000        /* (*)    */
  674. #define CFM_REVAUTHOR        0x00008000
  675.  
  676. #define CFE_SUBSCRIPT        0x00010000        /* Superscript and subscript are */
  677. #define CFE_SUPERSCRIPT        0x00020000        /*  mutually exclusive             */
  678.  
  679. #define CFM_SUBSCRIPT        CFE_SUBSCRIPT | CFE_SUPERSCRIPT
  680. #define CFM_SUPERSCRIPT        CFM_SUBSCRIPT
  681.  
  682. #define    CFM_EFFECTS2 (CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS \
  683.                     | CFM_HIDDEN  | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS \
  684.                     | CFM_IMPRINT | CFM_DISABLED | CFM_REVISED \
  685.                     | CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR)
  686.  
  687. #define CFM_ALL2     (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID \
  688.                     | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR \
  689.                     | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION)
  690.  
  691. #define    CFE_SMALLCAPS        CFM_SMALLCAPS
  692. #define    CFE_ALLCAPS            CFM_ALLCAPS
  693. #define    CFE_HIDDEN            CFM_HIDDEN
  694. #define    CFE_OUTLINE            CFM_OUTLINE
  695. #define    CFE_SHADOW            CFM_SHADOW
  696. #define    CFE_EMBOSS            CFM_EMBOSS
  697. #define    CFE_IMPRINT            CFM_IMPRINT
  698. #define    CFE_DISABLED        CFM_DISABLED
  699. #define    CFE_REVISED            CFM_REVISED
  700.  
  701. /* NOTE: CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and
  702.    CFM_BACKCOLOR, respectively, which control them */
  703. #define CFE_AUTOBACKCOLOR    CFM_BACKCOLOR
  704.  
  705. /* Underline types */
  706. #define CFU_CF1UNDERLINE    0xFF    /* map charformat's bit underline to CF2.*/
  707. #define CFU_INVERT            0xFE    /* For IME composition fake a selection.*/    
  708. #define    CFU_UNDERLINEDOTTED    0x4        /* (*) displayed as ordinary underline    */
  709. #define    CFU_UNDERLINEDOUBLE    0x3        /* (*) displayed as ordinary underline    */
  710. #define CFU_UNDERLINEWORD    0x2        /* (*) displayed as ordinary underline    */
  711. #define CFU_UNDERLINE        0x1
  712. #define CFU_UNDERLINENONE    0
  713.  
  714. #ifdef __cplusplus
  715. struct PARAFORMAT2 : _paraformat
  716. {
  717.     LONG    dySpaceBefore;            /* Vertical spacing before para            */
  718.     LONG    dySpaceAfter;            /* Vertical spacing after para            */    
  719.     LONG    dyLineSpacing;            /* Line spacing depending on Rule        */
  720.     SHORT    sStyle;                    /* Style handle                            */
  721.     BYTE    bLineSpacingRule;        /* Rule for line spacing (see tom.doc)    */
  722.     BYTE    bCRC;                    /* Reserved for CRC for rapid searching    */
  723.     WORD    wShadingWeight;            /* Shading in hundredths of a per cent    */
  724.     WORD    wShadingStyle;            /* Nibble 0: style, 1: cfpat, 2: cbpat    */
  725.     WORD    wNumberingStart;        /* Starting value for numbering            */
  726.     WORD    wNumberingStyle;        /* Alignment, roman/arabic, (), ), ., etc.*/
  727.     WORD    wNumberingTab;            /* Space bet FirstIndent and 1st-line text*/
  728.     WORD    wBorderSpace;            /* Space between border and text (twips)*/
  729.     WORD    wBorderWidth;            /* Border pen width (twips)                */
  730.     WORD    wBorders;                /* Byte 0: bits specify which borders    */
  731.                                     /* Nibble 2: border style, 3: color index*/
  732. };
  733.  
  734. #else    /* regular C-style    */
  735.  
  736. typedef struct _paraformat2
  737. {
  738.     UINT    cbSize;
  739.     _WPAD    _wPad1;
  740.     DWORD    dwMask;
  741.     WORD    wNumbering;
  742. #if (_RICHEDIT_VER >= 0x0210)
  743.     WORD    wEffects;
  744. #else
  745.     WORD    wReserved;
  746. #endif /* _RICHEDIT_VER >= 0x0210 */
  747.     LONG    dxStartIndent;
  748.     LONG    dxRightIndent;
  749.     LONG    dxOffset;
  750.     WORD    wAlignment;
  751.     SHORT    cTabCount;
  752.     LONG    rgxTabs[MAX_TAB_STOPS];
  753.      LONG    dySpaceBefore;            /* Vertical spacing before para            */
  754.     LONG    dySpaceAfter;            /* Vertical spacing after para            */
  755.     LONG    dyLineSpacing;            /* Line spacing depending on Rule        */
  756.     SHORT    sStyle;                    /* Style handle                            */
  757.     BYTE    bLineSpacingRule;        /* Rule for line spacing (see tom.doc)    */
  758.     BYTE    bCRC;                    /* Reserved for CRC for rapid searching    */
  759.     WORD    wShadingWeight;            /* Shading in hundredths of a per cent    */
  760.     WORD    wShadingStyle;            /* Nibble 0: style, 1: cfpat, 2: cbpat    */
  761.     WORD    wNumberingStart;        /* Starting value for numbering            */    
  762.     WORD    wNumberingStyle;        /* Alignment, roman/arabic, (), ), ., etc.*/
  763.     WORD    wNumberingTab;            /* Space bet 1st indent and 1st-line text*/
  764.     WORD    wBorderSpace;            /* Space between border and text (twips)*/
  765.     WORD    wBorderWidth;            /* Border pen width (twips)                */
  766.     WORD    wBorders;                /* Byte 0: bits specify which borders    */
  767.                                     /* Nibble 2: border style, 3: color index*/
  768. } PARAFORMAT2;
  769.  
  770. #endif /* C++    */
  771.  
  772. /* PARAFORMAT 2.0 masks and effects */
  773.  
  774. #define PFM_SPACEBEFORE            0x00000040
  775. #define PFM_SPACEAFTER            0x00000080
  776. #define PFM_LINESPACING            0x00000100
  777. #define    PFM_STYLE                0x00000400
  778. #define PFM_BORDER                0x00000800    /* (*)    */
  779. #define PFM_SHADING                0x00001000    /* (*)    */
  780. #define PFM_NUMBERINGSTYLE        0x00002000    /* (*)    */
  781. #define PFM_NUMBERINGTAB        0x00004000    /* (*)    */
  782. #define PFM_NUMBERINGSTART        0x00008000    /* (*)    */
  783.  
  784. #define PFM_DIR                    0x00010000
  785. #define PFM_RTLPARA                0x00010000    /* (Version 1.0 flag) */
  786. #define PFM_KEEP                0x00020000    /* (*)    */
  787. #define PFM_KEEPNEXT            0x00040000    /* (*)    */
  788. #define PFM_PAGEBREAKBEFORE        0x00080000    /* (*)    */
  789. #define PFM_NOLINENUMBER        0x00100000    /* (*)    */
  790. #define PFM_NOWIDOWCONTROL        0x00200000    /* (*)    */
  791. #define PFM_DONOTHYPHEN            0x00400000    /* (*)    */
  792. #define PFM_SIDEBYSIDE            0x00800000    /* (*)    */
  793.  
  794. #define PFM_TABLE                0xc0000000    /* (*)    */
  795.  
  796. /* Note: PARAFORMAT has no effects */
  797. #define PFM_EFFECTS  (PFM_DIR | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE \
  798.                     | PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER  \
  799.                     | PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE \
  800.                     | PFM_TABLE)
  801.  
  802. #define PFM_ALL2    (PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER \
  803.                     | PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER \
  804.                     | PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE)
  805.  
  806. #define PFE_RTLPARA                (PFM_DIR             >> 16)
  807. #define PFE_RTLPAR                (PFM_RTLPARA         >> 16)    /* (Version 1.0 flag) */
  808. #define PFE_KEEP                (PFM_KEEP             >> 16)    /* (*)    */
  809. #define PFE_KEEPNEXT            (PFM_KEEPNEXT         >> 16)    /* (*)    */
  810. #define PFE_PAGEBREAKBEFORE        (PFM_PAGEBREAKBEFORE >> 16)    /* (*)    */
  811. #define PFE_NOLINENUMBER        (PFM_NOLINENUMBER     >> 16)    /* (*)    */
  812. #define PFE_NOWIDOWCONTROL        (PFM_NOWIDOWCONTROL     >> 16)    /* (*)    */
  813. #define PFE_DONOTHYPHEN            (PFM_DONOTHYPHEN      >> 16)    /* (*)    */
  814. #define PFE_SIDEBYSIDE            (PFM_SIDEBYSIDE         >> 16)    /* (*)    */
  815.  
  816. #define PFE_TABLEROW            0xc000        /* These 3 options are mutually    */
  817. #define PFE_TABLECELLEND        0x8000        /*  exclusive and each imply    */
  818. #define PFE_TABLECELL            0x4000        /*  that para is part of a table*/
  819.  
  820. /*
  821.  *    PARAFORMAT numbering options (values for wNumbering):
  822.  *
  823.  *        Numbering Type        Value    Meaning
  824.  *        tomNoNumbering          0        Turn off paragraph numbering
  825.  *        tomNumberAsLCLetter      1        a, b, c, ...
  826.  *        tomNumberAsUCLetter      2        A, B, C, ...
  827.  *        tomNumberAsLCRoman      3        i, ii, iii, ...
  828.  *        tomNumberAsUCRoman      4        I, II, III, ...
  829.  *        tomNumberAsSymbols      5        default is bullet
  830.  *        tomNumberAsNumber      6        0, 1, 2, ...
  831.  *        tomNumberAsSequence      7        tomNumberingStart is first Unicode to use
  832.  *
  833.  *    Other valid Unicode chars are Unicodes for bullets.
  834.  */
  835.  
  836.  
  837. #define    PFA_JUSTIFY            4    /* New paragraph-alignment option 2.0 (*)
  838.  
  839.  
  840. /* notification structures */
  841.  
  842. #ifndef WM_NOTIFY
  843. #define WM_NOTIFY                0x004E
  844.  
  845. typedef struct _nmhdr
  846. {
  847.     HWND    hwndFrom;
  848.     _WPAD    _wPad1;
  849.     UINT    idFrom;
  850.     _WPAD    _wPad2;
  851.     UINT    code;
  852.     _WPAD    _wPad3;
  853. } NMHDR;
  854. #endif  /* !WM_NOTIFY */
  855.  
  856. typedef struct _msgfilter
  857. {
  858.     NMHDR    nmhdr;
  859.     UINT    msg;
  860.     _WPAD    _wPad1;
  861.     WPARAM    wParam;
  862.     _WPAD    _wPad2;
  863.     LPARAM    lParam;
  864. } MSGFILTER;
  865.  
  866. typedef struct _reqresize
  867. {
  868.     NMHDR nmhdr;
  869.     RECT rc;
  870. } REQRESIZE;
  871.  
  872. typedef struct _selchange
  873. {
  874.     NMHDR nmhdr;
  875.     CHARRANGE chrg;
  876.     WORD seltyp;
  877. } SELCHANGE;
  878.  
  879. #define SEL_EMPTY        0x0000
  880. #define SEL_TEXT        0x0001
  881. #define SEL_OBJECT        0x0002
  882. #define SEL_MULTICHAR    0x0004
  883. #define SEL_MULTIOBJECT    0x0008
  884.  
  885. /* used with IRichEditOleCallback::GetContextMenu, this flag will be
  886.    passed as a "selection type".  It indicates that a context menu for
  887.    a right-mouse drag drop should be generated.  The IOleObject parameter
  888.    will really be the IDataObject for the drop
  889.  */
  890. #define GCM_RIGHTMOUSEDROP  0x8000
  891.  
  892. typedef struct _endropfiles
  893. {
  894.     NMHDR nmhdr;
  895.     HANDLE hDrop;
  896.     LONG cp;
  897.     BOOL fProtected;
  898. } ENDROPFILES;
  899.  
  900. typedef struct _enprotected
  901. {
  902.     NMHDR nmhdr;
  903.     UINT msg;
  904.     _WPAD    _wPad1;
  905.     WPARAM wParam;
  906.     _WPAD    _wPad2;
  907.     LPARAM lParam;
  908.     CHARRANGE chrg;
  909. } ENPROTECTED;
  910.  
  911. typedef struct _ensaveclipboard
  912. {
  913.     NMHDR nmhdr;
  914.     LONG cObjectCount;
  915.     LONG cch;
  916. } ENSAVECLIPBOARD;
  917.  
  918. #ifndef MACPORT
  919. typedef struct _enoleopfailed
  920. {
  921.     NMHDR nmhdr;
  922.     LONG iob;
  923.     LONG lOper;
  924.     HRESULT hr;
  925. } ENOLEOPFAILED;
  926. #endif
  927.  
  928. #define    OLEOP_DOVERB    1
  929.  
  930. typedef struct _objectpositions
  931. {
  932.     NMHDR nmhdr;
  933.     LONG cObjectCount;
  934.     LONG *pcpPositions;
  935. } OBJECTPOSITIONS;
  936.  
  937. typedef struct _enlink
  938. {
  939.     NMHDR nmhdr;
  940.     UINT msg;
  941.     _WPAD   _wPad1;
  942.     WPARAM wParam;
  943.     _WPAD   _wPad2;
  944.     LPARAM lParam;
  945.     CHARRANGE chrg;
  946. } ENLINK;
  947.  
  948. /* PenWin specific */
  949. typedef struct _encorrecttext
  950. {
  951.     NMHDR nmhdr;
  952.     CHARRANGE chrg;
  953.     WORD seltyp;
  954. } ENCORRECTTEXT;
  955.  
  956. /* Far East specific */
  957. typedef struct _punctuation
  958. {
  959.     UINT    iSize;
  960.     LPSTR    szPunctuation;
  961. } PUNCTUATION;
  962.  
  963. /* Far East specific */
  964. typedef struct _compcolor
  965. {
  966.     COLORREF crText;
  967.     COLORREF crBackground;
  968.     DWORD dwEffects;
  969. }COMPCOLOR;
  970.  
  971.  
  972. /* clipboard formats - use as parameter to RegisterClipboardFormat() */
  973. #define CF_RTF             TEXT("Rich Text Format")
  974. #define CF_RTFNOOBJS     TEXT("Rich Text Format Without Objects")
  975. #define CF_RETEXTOBJ     TEXT("RichEdit Text and Objects")
  976.  
  977. /* Paste Special */
  978. typedef struct _repastespecial
  979. {
  980.     DWORD    dwAspect;
  981.     DWORD    dwParam;
  982. } REPASTESPECIAL;
  983.  
  984. /*    UndoName info */
  985. typedef enum _undonameid
  986. {
  987.     UID_UNKNOWN     = 0,
  988.     UID_TYPING        = 1,
  989.     UID_DELETE         = 2,
  990.     UID_DRAGDROP    = 3,
  991.     UID_CUT            = 4,
  992.     UID_PASTE        = 5
  993. } UNDONAMEID;
  994.  
  995. /* flags for the GETEXTEX data structure */
  996. #define GT_DEFAULT        0
  997. #define GT_USECRLF        1
  998.  
  999. /* EM_GETTEXTEX info; this struct is passed in the wparam of the message */
  1000. typedef struct _gettextex
  1001. {
  1002.     DWORD    cb;                /* count of bytes in the string                */
  1003.     DWORD    flags;            /* flags (see the GT_XXX defines            */
  1004.     UINT    codepage;        /* code page for translation (CP_ACP for default,
  1005.                                1200 for Unicode                            */
  1006.     LPCSTR    lpDefaultChar;    /* replacement for unmappable chars            */
  1007.     LPBOOL    lpUsedDefChar;    /* pointer to flag set when def char used    */
  1008. } GETTEXTEX;
  1009.  
  1010. /* flags for the GETTEXTLENGTHEX data structure                            */
  1011. #define GTL_DEFAULT        0    /* do the default (return # of chars)        */
  1012. #define GTL_USECRLF        1    /* compute answer using CRLFs for paragraphs*/
  1013. #define GTL_PRECISE        2    /* compute a precise answer                    */
  1014. #define GTL_CLOSE        4    /* fast computation of a "close" answer        */
  1015. #define GTL_NUMCHARS    8    /* return the number of characters            */
  1016. #define GTL_NUMBYTES    16    /* return the number of _bytes_                */
  1017.  
  1018. /* EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg */
  1019. typedef struct _gettextlengthex
  1020. {
  1021.     DWORD    flags;            /* flags (see GTL_XXX defines)                */
  1022.     UINT    codepage;        /* code page for translation (CP_ACP for default,
  1023.                                1200 for Unicode                            */
  1024. } GETTEXTLENGTHEX;
  1025.     
  1026. /* BiDi specific features */
  1027. typedef struct _bidioptions
  1028. {
  1029.     UINT    cbSize;
  1030.     _WPAD    _wPad1;
  1031.     WORD    wMask;
  1032.     WORD    wEffects; 
  1033. } BIDIOPTIONS;
  1034.  
  1035. /* BIDIOPTIONS masks */
  1036. #if (_RICHEDIT_VER == 0x0100)
  1037. #define BOM_DEFPARADIR            0x0001    /* Default paragraph direction (implies alignment) (obsolete) */
  1038. #define BOM_PLAINTEXT            0x0002    /* Use plain text layout (obsolete) */
  1039. #define BOM_NEUTRALOVERRIDE        0x0004    /* Override neutral layout (obsolete) */
  1040. #endif /* _RICHEDIT_VER == 0x0100 */
  1041. #define BOM_CONTEXTREADING        0x0008    /* Context reading order */
  1042. #define BOM_CONTEXTALIGNMENT    0x0010    /* Context alignment */
  1043.  
  1044. /* BIDIOPTIONS effects */
  1045. #if (_RICHEDIT_VER == 0x0100)
  1046. #define BOE_RTLDIR                0x0001    /* Default paragraph direction (implies alignment) (obsolete) */
  1047. #define BOE_PLAINTEXT            0x0002    /* Use plain text layout (obsolete) */
  1048. #define BOE_NEUTRALOVERRIDE        0x0004    /* Override neutral layout (obsolete) */
  1049. #endif /* _RICHEDIT_VER == 0x0100 */
  1050. #define BOE_CONTEXTREADING        0x0008    /* Context reading order */
  1051. #define BOE_CONTEXTALIGNMENT    0x0010    /* Context alignment */
  1052.  
  1053. /* Additional EM_FINDTEXT[EX] flags */
  1054. #define FR_MATCHDIAC                    0x20000000
  1055. #define FR_MATCHKASHIDA                 0x40000000
  1056. #define FR_MATCHALEFHAMZA               0x80000000
  1057.  
  1058. /* UNICODE embedding character */
  1059. #ifndef WCH_EMBEDDING
  1060. #define WCH_EMBEDDING (WCHAR)0xFFFC
  1061. #endif /* WCH_EMBEDDING */
  1062.         
  1063.  
  1064. #undef _WPAD
  1065.  
  1066. #ifdef _WIN32
  1067. #include <poppack.h>
  1068. #elif !defined(RC_INVOKED)
  1069. #pragma pack()
  1070. #endif
  1071.  
  1072. #ifdef __cplusplus
  1073. }
  1074. #endif  /* __cplusplus */
  1075.  
  1076. #endif /* !_RICHEDIT_ */
  1077.  
  1078.