richedit.bmx 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807
  1. Strict
  2. Import "user32.bmx"
  3. Const EN_MSGFILTER=$0700
  4. Const EN_REQUESTRESIZE=$0701
  5. Const EN_SELCHANGE=$0702
  6. Const EN_DROPFILES=$0703
  7. Const EN_PROTECTED=$0704
  8. Const EN_CORRECTTEXT=$0705 ' PenWin specific
  9. Const EN_STOPNOUNDO=$0706
  10. Const EN_IMECHANGE=$0707 ' East Asia specific
  11. Const EN_SAVECLIPBOARD=$0708
  12. Const EN_OLEOPFAILED=$0709
  13. Const EN_OBJECTPOSITIONS=$070a
  14. Const EN_LINK=$070b
  15. Const EN_DRAGDROPDONE=$070c
  16. Const EN_PARAGRAPHEXPANDED=$070d
  17. Const EN_PAGECHANGE=$070e
  18. Const EN_LOWFIRTF=$070f
  19. Const EN_ALIGNLTR=$0710 ' BiDi specific notification
  20. Const EN_ALIGNRTL=$0711 ' BiDi specific notification
  21. ' Event notification masks
  22. Const ENM_NONE=0
  23. Const ENM_CHANGE=1
  24. Const ENM_UPDATE=2
  25. Const ENM_SCROLL=4
  26. Const ENM_SCROLLEVENTS=8
  27. Const ENM_DRAGDROPDONE=$10
  28. Const ENM_PARAGRAPHEXPANDED=$20
  29. Const ENM_PAGECHANGE=$40
  30. Const ENM_KEYEVENTS=$10000
  31. Const ENM_MOUSEEVENTS=$20000
  32. Const ENM_REQUESTRESIZE=$40000
  33. Const ENM_SELCHANGE=$80000
  34. Const ENM_DROPFILES=$100000
  35. Const ENM_PROTECTED=$200000
  36. Const ENM_CORRECTTEXT=$400000 ' PenWin specific
  37. Const ENM_IMECHANGE=$800000 ' Used by RE1.0 compatibility
  38. Const ENM_LANGCHANGE=$1000000
  39. Const ENM_OBJECTPOSITIONS=$2000000
  40. Const ENM_LINK=$4000000
  41. Const ENM_LOWFIRTF=$8000000
  42. ' events
  43. Const WM_UNICHAR=$0109
  44. ' codepage defaults
  45. Const CP_ACP=0 'Default to ANSI code page
  46. Const CP_OEMCP=1 'Default to OEM code page */
  47. Rem
  48. Const EM_GETLIMITTEXT=WM_USER+37
  49. Const EM_POSFROMCHAR =WM_USER+38
  50. Const EM_CHARFROMPOS =WM_USER+39
  51. Const EM_SCROLLCARET=WM_USER+49
  52. Const EM_CANPASTE=WM_USER+50
  53. Const EM_DISPLAYBAND=WM_USER+51
  54. Const EM_EXGETSEL=WM_USER+52
  55. Const EM_EXLIMITTEXT=WM_USER+53
  56. Const EM_EXLINEFROMCHAR=WM_USER+54
  57. Const EM_EXSETSEL =WM_USER+55
  58. Const EM_FINDTEXT=WM_USER+56
  59. Const EM_FORMATRANGE=WM_USER+57
  60. Const EM_GETCHARFORMAT=WM_USER+58
  61. Const EM_GETEVENTMASK=WM_USER+59
  62. Const EM_GETOLEINTERFACE=WM_USER+60
  63. Const EM_GETPARAFORMAT=WM_USER+61
  64. Const EM_GETSELTEXT=WM_USER+62
  65. Const EM_HIDESELECTION=WM_USER+63
  66. Const EM_PASTESPECIAL=WM_USER+64
  67. Const EM_REQUESTRESIZE=WM_USER+65
  68. Const EM_SELECTIONTYPE=WM_USER+66
  69. Const EM_SETBKGNDCOLOR=WM_USER+67
  70. Const EM_SETCHARFORMAT=WM_USER+68
  71. Const EM_SETEVENTMASK=WM_USER+69
  72. Const EM_SETOLECALLBACK=WM_USER+70
  73. Const EM_SETPARAFORMAT=WM_USER+71
  74. Const EM_SETTARGETDEVICE=WM_USER+72
  75. Const EM_STREAMIN=WM_USER+73
  76. Const EM_STREAMOUT=WM_USER+74
  77. Const EM_GETTEXTRANGE=WM_USER+75
  78. Const EM_FINDWORDBREAK=WM_USER+76
  79. Const EM_SETOPTIONS=WM_USER+77
  80. Const EM_GETOPTIONS=WM_USER+78
  81. Const EM_FINDTEXTEX=WM_USER+79
  82. Const EM_GETWORDBREAKPROCEX=WM_USER+80
  83. Const EM_SETWORDBREAKPROCEX=WM_USER+81
  84. ' RichEdit 2.0 messages
  85. Const EM_SETUNDOLIMIT=WM_USER+82
  86. Const EM_REDO=WM_USER+84
  87. Const EM_CANREDO =WM_USER+85
  88. Const EM_GETUNDONAME=WM_USER+86
  89. Const EM_GETREDONAME=WM_USER+87
  90. Const EM_STOPGROUPTYPING=WM_USER+88
  91. Const EM_SETTEXTMODE=WM_USER+89
  92. Const EM_GETTEXTMODE=WM_USER+90
  93. ' TEXTMODE enum for use with EM_GET/SETTEXTMODE
  94. Const TM_PLAINTEXT=1
  95. Const TM_RICHTEXT=2 'Default behavior
  96. Const TM_SINGLELEVELUNDO=4
  97. Const TM_MULTILEVELUNDO=8 ' Default behavior
  98. Const TM_SINGLECODEPAGE=16
  99. Const TM_MULTICODEPAGE=32 ' Default behavior
  100. Const EM_AUTOURLDETECT=WM_USER+91
  101. Const EM_GETAUTOURLDETECT=WM_USER+92
  102. Const EM_SETPALETTE=WM_USER+93
  103. Const EM_GETTEXTEX=WM_USER+94
  104. Const EM_GETTEXTLENGTHEX=WM_USER+95
  105. Const EM_SHOWSCROLLBAR=WM_USER+96
  106. Const EM_SETTEXTEX=WM_USER+97
  107. ' East Asia specific messages
  108. Const EM_SETPUNCTUATION=WM_USER+100
  109. Const EM_GETPUNCTUATION=WM_USER+101
  110. Const EM_SETWORDWRAPMODE=WM_USER+102
  111. Const EM_GETWORDWRAPMODE=WM_USER+103
  112. Const EM_SETIMECOLOR=WM_USER+104
  113. Const EM_GETIMECOLOR=WM_USER+105
  114. Const EM_SETIMEOPTIONS=WM_USER+106
  115. Const EM_GETIMEOPTIONS=WM_USER+107
  116. Const EM_CONVPOSITION =WM_USER+108
  117. Const EM_SETLANGOPTIONS=WM_USER+120
  118. Const EM_GETLANGOPTIONS=WM_USER+121
  119. Const EM_GETIMECOMPMODE=WM_USER+122
  120. Const EM_FINDTEXTW=WM_USER+123
  121. Const EM_FINDTEXTEXW=WM_USER+124
  122. ' RE3.0 FE messages
  123. Const EM_RECONVERSION=WM_USER+125
  124. Const EM_SETIMEMODEBIAS=WM_USER+126
  125. Const EM_GETIMEMODEBIAS=WM_USER+127
  126. ' BiDi specific messages
  127. Const EM_SETBIDIOPTIONS=WM_USER+200
  128. Const EM_GETBIDIOPTIONS=WM_USER+201
  129. Const EM_SETTYPOGRAPHYOPTIONS=WM_USER+202
  130. Const EM_GETTYPOGRAPHYOPTIONS=WM_USER+203
  131. ' Extended edit style specific messages
  132. Const EM_SETEDITSTYLE=WM_USER+204
  133. Const EM_GETEDITSTYLE=WM_USER+205
  134. EndRem
  135. Const GTL_DEFAULT=0 ' Do default (return # of chars
  136. Const GTL_USECRLF=1 ' Compute answer using CRLFs for paragraphs
  137. Const GTL_PRECISE=2 ' Compute a precise answer
  138. Const GTL_CLOSE=4 ' Fast computation of a "close" answer
  139. Const GTL_NUMCHARS=8 ' Return number of characters
  140. Const GTL_NUMBYTES=16 ' Return number of _bytes_
  141. Const EM_GETSEL=$B0
  142. Const EM_SETSEL=$B1
  143. Const EM_GETRECT=$B2
  144. Const EM_SETRECT=$B3
  145. Const EM_SETRECTNP=$B4
  146. Const EM_SCROLL=$B5
  147. Const EM_LINESCROLL=$B6
  148. Const EM_SCROLLCARET=$B7
  149. Const EM_GETMODIFY=$B8
  150. Const EM_SETMODIFY=$B9
  151. Const EM_GETLINECOUNT=$BA
  152. Const EM_LINEINDEX=$BB
  153. Const EM_SETHANDLE=$BC
  154. Const EM_GETHANDLE=$BD
  155. Const EM_GETTHUMB=$BE
  156. Const EM_LINELENGTH=$C1
  157. Const EM_REPLACESEL=$C2
  158. Const EM_GETLINE=$C4
  159. Const EM_LIMITTEXT=$C5
  160. Const EM_CANUNDO=$C6
  161. Const EM_UNDO=$C7
  162. Const EM_FMTLINES=$C8
  163. Const EM_LINEFROMCHAR=$C9
  164. Const EM_SETTABSTOPS=$CB
  165. Const EM_SETPASSWORDCHAR=$CC
  166. Const EM_EMPTYUNDOBUFFER=$CD
  167. Const EM_GETFIRSTVISIBLELINE=$CE
  168. Const EM_SETREADONLY=$CF
  169. Const EM_SETWORDBREAKPROC=$D0
  170. Const EM_GETWORDBREAKPROC=$D1
  171. Const EM_GETPASSWORDCHAR=$D2
  172. Const EM_SETMARGINS=$D3
  173. Const EM_GETMARGINS=$D4
  174. Const EM_SETLIMITTEXT=EM_LIMITTEXT
  175. Const EM_GETLIMITTEXT=$D5
  176. Const EM_POSFROMCHAR=$D6
  177. Const EM_CHARFROMPOS=$D7
  178. Const EM_SETIMESTATUS=$D8
  179. Const EM_GETIMESTATUS=$D9
  180. Const EM_CANPASTE=WM_USER+50
  181. Const EM_DISPLAYBAND=WM_USER+51
  182. Const EM_EXGETSEL=WM_USER+52
  183. Const EM_EXLIMITTEXT=WM_USER+53
  184. Const EM_EXLINEFROMCHAR=WM_USER+54
  185. Const EM_EXSETSEL=WM_USER+55
  186. Const EM_FINDTEXT=WM_USER+56
  187. Const EM_FORMATRANGE=WM_USER+57
  188. Const EM_GETCHARFORMAT=WM_USER+58
  189. Const EM_GETEVENTMASK=WM_USER+59
  190. Const EM_GETOLEINTERFACE=WM_USER+60
  191. Const EM_GETPARAFORMAT=WM_USER+61
  192. Const EM_GETSELTEXT=WM_USER+62
  193. Const EM_HIDESELECTION=WM_USER+63
  194. Const EM_PASTESPECIAL=WM_USER+64
  195. Const EM_REQUESTRESIZE=WM_USER+65
  196. Const EM_SELECTIONTYPE=WM_USER+66
  197. Const EM_SETBKGNDCOLOR=WM_USER+67
  198. Const EM_SETCHARFORMAT=WM_USER+68
  199. Const EM_SETEVENTMASK=WM_USER+69
  200. Const EM_SETOLECALLBACK=WM_USER+70
  201. Const EM_SETPARAFORMAT=WM_USER+71
  202. Const EM_SETTARGETDEVICE=WM_USER+72
  203. Const EM_STREAMIN=WM_USER+73
  204. Const EM_STREAMOUT=WM_USER+74
  205. Const EM_GETTEXTRANGE=WM_USER+75
  206. Const EM_FINDWORDBREAK=WM_USER+76
  207. Const EM_SETOPTIONS=WM_USER+77
  208. Const EM_GETOPTIONS=WM_USER+78
  209. Const EM_FINDTEXTEX=WM_USER+79
  210. Const EM_GETWORDBREAKPROCEX=WM_USER+80
  211. Const EM_SETWORDBREAKPROCEX=WM_USER+81
  212. Const EM_SETUNDOLIMIT=WM_USER+82
  213. Const EM_REDO=WM_USER+84
  214. Const EM_CANREDO=WM_USER+85
  215. Const EM_GETUNDONAME=WM_USER+86
  216. Const EM_GETREDONAME=WM_USER+87
  217. Const EM_STOPGROUPTYPING=WM_USER+88
  218. Const EM_SETTEXTMODE=WM_USER+89
  219. Const EM_GETTEXTMODE=WM_USER+90
  220. Const TM_PLAINTEXT=1
  221. Const TM_RICHTEXT=2 'Defaultbehavior
  222. Const TM_SINGLELEVELUNDO=4
  223. Const TM_MULTILEVELUNDO=8 'Defaultbehavior
  224. Const TM_SINGLECODEPAGE=16
  225. Const TM_MULTICODEPAGE=32 'Defaultbehavior
  226. Const EM_AUTOURLDETECT=WM_USER+91
  227. Const EM_GETAUTOURLDETECT=WM_USER+92
  228. Const EM_SETPALETTE=WM_USER+93
  229. Const EM_GETTEXTEX=WM_USER+94
  230. Const EM_GETTEXTLENGTHEX=WM_USER+95
  231. Const EM_SHOWSCROLLBAR=WM_USER+96
  232. Const EM_SETTEXTEX=WM_USER+97
  233. 'EastAsiaspecificmessages
  234. Const EM_SETPUNCTUATION=WM_USER+100
  235. Const EM_GETPUNCTUATION=WM_USER+101
  236. Const EM_SETWORDWRAPMODE=WM_USER+102
  237. Const EM_GETWORDWRAPMODE=WM_USER+103
  238. Const EM_SETIMECOLOR=WM_USER+104
  239. Const EM_GETIMECOLOR=WM_USER+105
  240. Const EM_SETIMEOPTIONS=WM_USER+106
  241. Const EM_GETIMEOPTIONS=WM_USER+107
  242. Const EM_CONVPOSITION=WM_USER+108
  243. Const EM_SETLANGOPTIONS=WM_USER+120
  244. Const EM_GETLANGOPTIONS=WM_USER+121
  245. Const EM_GETIMECOMPMODE=WM_USER+122
  246. Const EM_FINDTEXTW=WM_USER+123
  247. Const EM_FINDTEXTEXW=WM_USER+124
  248. 'RE3.0FEmessages
  249. Const EM_RECONVERSION=WM_USER+125
  250. Const EM_SETIMEMODEBIAS=WM_USER+126
  251. Const EM_GETIMEMODEBIAS=WM_USER+127
  252. 'BiDispecificmessages
  253. Const EM_SETBIDIOPTIONS=WM_USER+200
  254. Const EM_GETBIDIOPTIONS=WM_USER+201
  255. Const EM_SETTYPOGRAPHYOPTIONS=WM_USER+202
  256. Const EM_GETTYPOGRAPHYOPTIONS=WM_USER+203
  257. 'Extendededitstylespecificmessages
  258. Const EM_SETEDITSTYLE=WM_USER+204
  259. Const EM_GETEDITSTYLE=WM_USER+205
  260. Const SCF_SELECTION=1
  261. Const SCF_WORD=2
  262. Const SCF_DEFAULT=0
  263. Const SCF_ALL=4
  264. Const SCF_USEUIRULES=8
  265. Const SCF_ASSOCIATEFONT=16
  266. Const SCF_NOKBUPDATE=32
  267. Const SCF_ASSOCIATEFONT2=64
  268. Const CFE_BOLD=1
  269. Const CFE_ITALIC=2
  270. Const CFE_UNDERLINE=4
  271. Const CFE_STRIKEOUT=8
  272. Const CFE_PROTECTED=16
  273. Const CFE_LINK=32
  274. Const CFE_AUTOCOLOR=$40000000
  275. Const CFM_BOLD=1
  276. Const CFM_ITALIC=2
  277. Const CFM_UNDERLINE=4
  278. Const CFM_STRIKEOUT=8
  279. Const CFM_PROTECTED=16
  280. Const CFM_LINK=32
  281. Const CFM_SIZE=$80000000
  282. Const CFM_COLOR=$40000000
  283. Const CFM_FACE=$20000000
  284. Const CFM_OFFSET=$10000000
  285. Const CFM_CHARSET=$08000000
  286. Const SF_TEXT=1
  287. Const SF_RTF=2
  288. Const SF_RTFNOOBJS=3
  289. Const SF_TEXTIZED=4
  290. Const SF_UNICODE=$10
  291. Const SF_USECODEPAGE=$20
  292. Const SF_NCRFORNONASCII=$40
  293. Const SF_RTFVAL=$700
  294. Const SFF_WRITEXTRAPAR=$80
  295. Const SFF_SELECTION=$8000
  296. Const SFF_PLAINRTF=$4000
  297. Const SFF_PERSISTVIEWSCALE=$2000
  298. Const SFF_KEEPDOCINFO=$1000
  299. Const SFF_PWD=$800
  300. Const PFM_STARTINDENT=1
  301. Const PFM_RIGHTINDENT=2
  302. Const PFM_OFFSET=4
  303. Const PFM_ALIGNMENT=8
  304. Const PFM_TABSTOPS=16
  305. Const PFM_NUMBERING=32
  306. Const PFM_OFFSETINDENT=$80000000
  307. Const PFM_SPACEBEFORE=$40
  308. Const PFM_SPACEAFTER=$80
  309. Const PFM_LINESPACING=$100
  310. Const PFM_STYLE=$400
  311. Const PFM_BORDER=$800
  312. Const PFM_SHADING=$1000
  313. Const PFM_NUMBERINGSTYLE=$2000
  314. Const PFM_NUMBERINGTAB=$4000
  315. Const PFM_NUMBERINGSTART=$8000
  316. Const PFM_RTLPARA=$10000
  317. Const PFM_KEEP=$20000
  318. Const PFM_KEEPNEXT=$40000
  319. Const PFM_PAGEBREAKBEFORE=$80000
  320. Const PFM_NOLINENUMBER=$100000
  321. Const PFM_NOWIDOWCONTROL=$200000
  322. Const PFM_DONOTHYPHEN=$400000
  323. Const PFM_SIDEBYSIDE=$800000
  324. Const PFM_TABLE=$40000000
  325. Const PFM_TEXTWRAPPINGBREAK=$20000000
  326. Const PFM_TABLEROWDELIMITER=$10000000
  327. Const PFM_COLLAPSED=$1000000
  328. Const PFM_OUTLINELEVEL=$2000000
  329. Const PFM_BOX=$4000000
  330. Const PFM_RESERVED2=$8000000
  331. Const MAX_TAB_STOPS=32
  332. Const lDefaultTab=720
  333. Const MAX_TABLE_CELLS=63
  334. Type EDITSTREAM
  335. Field dwCookie:Byte Ptr Ptr
  336. Field dwError
  337. Field pfnCallback(cookie:Byte Ptr Ptr,buff:Byte Ptr,n,n_out:Int Ptr) "win32"
  338. End Type
  339. Type TEXTRANGEW
  340. Field cpMin
  341. Field cpMax
  342. Field lpStrText:Short Ptr
  343. End Type
  344. Type CHARRANGE
  345. Field cpMin
  346. Field cpMax
  347. End Type
  348. Type CHARFORMATW
  349. Field cbSize
  350. Field dwMask
  351. Field dwEffects
  352. Field yHeight
  353. Field yOffset
  354. Field crTextColor
  355. Field bCharSet:Byte
  356. Field bPitchAndFamily:Byte
  357. Field lfFaceName00:Short
  358. Field lfFaceName01:Short
  359. Field lfFaceName02:Short
  360. Field lfFaceName03:Short
  361. Field lfFaceName04:Short
  362. Field lfFaceName05:Short
  363. Field lfFaceName06:Short
  364. Field lfFaceName07:Short
  365. Field lfFaceName08:Short
  366. Field lfFaceName09:Short
  367. Field lfFaceName0a:Short
  368. Field lfFaceName0b:Short
  369. Field lfFaceName0c:Short
  370. Field lfFaceName0d:Short
  371. Field lfFaceName0e:Short
  372. Field lfFaceName0f:Short
  373. Field lfFaceName10:Short
  374. Field lfFaceName11:Short
  375. Field lfFaceName12:Short
  376. Field lfFaceName13:Short
  377. Field lfFaceName14:Short
  378. Field lfFaceName15:Short
  379. Field lfFaceName16:Short
  380. Field lfFaceName17:Short
  381. Field lfFaceName18:Short
  382. Field lfFaceName19:Short
  383. Field lfFaceName1a:Short
  384. Field lfFaceName1b:Short
  385. Field lfFaceName1c:Short
  386. Field lfFaceName1d:Short
  387. Field lfFaceName1e:Short
  388. Field lfFaceName1f:Short
  389. Field pad:Short
  390. End Type
  391. Type CHARFORMAT
  392. Field cbSize
  393. Field dwMask
  394. Field dwEffects
  395. Field yHeight
  396. Field yOffset
  397. Field crTextColor
  398. Field bCharSet:Byte
  399. Field bPitchAndFamily:Byte
  400. Field lfFaceName00:Byte
  401. Field lfFaceName01:Byte
  402. Field lfFaceName02:Byte
  403. Field lfFaceName03:Byte
  404. Field lfFaceName04:Byte
  405. Field lfFaceName05:Byte
  406. Field lfFaceName06:Byte
  407. Field lfFaceName07:Byte
  408. Field lfFaceName08:Byte
  409. Field lfFaceName09:Byte
  410. Field lfFaceName0a:Byte
  411. Field lfFaceName0b:Byte
  412. Field lfFaceName0c:Byte
  413. Field lfFaceName0d:Byte
  414. Field lfFaceName0e:Byte
  415. Field lfFaceName0f:Byte
  416. Field lfFaceName10:Byte
  417. Field lfFaceName11:Byte
  418. Field lfFaceName12:Byte
  419. Field lfFaceName13:Byte
  420. Field lfFaceName14:Byte
  421. Field lfFaceName15:Byte
  422. Field lfFaceName16:Byte
  423. Field lfFaceName17:Byte
  424. Field lfFaceName18:Byte
  425. Field lfFaceName19:Byte
  426. Field lfFaceName1a:Byte
  427. Field lfFaceName1b:Byte
  428. Field lfFaceName1c:Byte
  429. Field lfFaceName1d:Byte
  430. Field lfFaceName1e:Byte
  431. Field lfFaceName1f:Byte
  432. Field pad:Short
  433. End Type
  434. Type PARAFORMAT
  435. Field cbSize
  436. Field dwMask
  437. Field wNumbering:Short
  438. Field wEffects:Short
  439. Field dxStartIndent
  440. Field dxRightIndent
  441. Field dxOffset
  442. Field wAlignment:Short
  443. Field cTabCount:Short
  444. Field rgxTabs00,rgxTabs01,rgxTabs02,rgxTabs03
  445. Field rgxTabs10,rgxTabs11,rgxTabs12,rgxTabs13
  446. Field rgxTabs20,rgxTabs21,rgxTabs22,rgxTabs23
  447. Field rgxTabs30,rgxTabs31,rgxTabs32,rgxTabs33
  448. Field rgxTabs40,rgxTabs41,rgxTabs42,rgxTabs43
  449. Field rgxTabs50,rgxTabs51,rgxTabs52,rgxTabs53
  450. Field rgxTabs60,rgxTabs61,rgxTabs62,rgxTabs63
  451. Field rgxTabs70,rgxTabs71,rgxTabs72,rgxTabs73
  452. End Type
  453. Rem
  454. /*
  455. * RICHEDIT.H
  456. *
  457. * Purpose:
  458. * RICHEDIT v2.0/3.0/4.0 public definitions
  459. * functionality available for v2.0 and 3.0 that is not in the original
  460. * Windows 95 release.
  461. *
  462. * Copyright (c Microsoft Corporation. All rights reserved.
  463. */
  464. #ifndef _RICHEDIT_
  465. const _RICHEDIT_
  466. #ifdef _WIN32
  467. #include <pshpack4.h>
  468. #elif !defined(RC_INVOKED
  469. #pragma pack(4
  470. #endif
  471. #ifdef __cplusplus
  472. extern "C" {
  473. #endif ' __cplusplus
  474. ' To mimic older RichEdit behavior, set _RICHEDIT_VER to appropriate value
  475. ' Version 1.0 =$0100
  476. ' Version 2.0 =$0200
  477. ' Version 2.1 =$0210
  478. #ifndef _RICHEDIT_VER
  479. const _RICHEDIT_VER =$0300
  480. #endif
  481. const cchTextLimitDefault 32767
  482. const MSFTEDIT_CLASS L"RICHEDIT50W"
  483. ' NOTE:MSFTEDIT.DLL only registers MSFTEDIT_CLASS.If an application wants
  484. ' to use the following Richedit classes, it needs to load the riched20.dll.
  485. ' Otherwise, CreateWindow with RICHEDIT_CLASS would fail.
  486. ' This also applies to any dialog that uses RICHEDIT_CLASS,
  487. ' RichEdit 2.0 Window Class
  488. ' On Windows CE, avoid possible conflicts on Win95
  489. const CERICHEDIT_CLASSA "RichEditCEA"
  490. const CERICHEDIT_CLASSW L"RichEditCEW"
  491. const RICHEDIT_CLASSA "RichEdit20A"
  492. const RICHEDIT_CLASS10A "RICHEDIT" ' Richedit 1.0
  493. #ifndef MACPORT
  494. const RICHEDIT_CLASSW L"RichEdit20W"
  495. #else '----------------------MACPORT
  496. const RICHEDIT_CLASSW TEXT("RichEdit20W" ' MACPORT change
  497. #endif ' MACPORT
  498. #if (_RICHEDIT_VER >==$0200
  499. #ifdef UNICODE
  500. const RICHEDIT_CLASS RICHEDIT_CLASSW
  501. #else
  502. const RICHEDIT_CLASS RICHEDIT_CLASSA
  503. #endif ' UNICODE
  504. #else
  505. const RICHEDIT_CLASS RICHEDIT_CLASS10A
  506. #endif ' _RICHEDIT_VER >==$0200
  507. ' RichEdit messages
  508. #ifndef WM_CONTEXTMENU
  509. const WM_CONTEXTMENU =$007B
  510. #endif
  511. #ifndef WM_UNICHAR
  512. const WM_UNICHAR =$0109
  513. #endif
  514. #ifndef WM_PRINTCLIENT
  515. const WM_PRINTCLIENT =$0318
  516. #endif
  517. #ifndef EM_GETLIMITTEXT
  518. const EM_GETLIMITTEXT =WM_USER+37
  519. #endif
  520. #ifndef EM_POSFROMCHAR
  521. const EM_POSFROMCHAR =WM_USER+38
  522. const EM_CHARFROMPOS =WM_USER+39
  523. #endif
  524. #ifndef EM_SCROLLCARET
  525. const EM_SCROLLCARET =WM_USER+49
  526. #endif
  527. const EM_CANPASTE =WM_USER+50
  528. const EM_DISPLAYBAND =WM_USER+51
  529. const EM_EXGETSEL =WM_USER+52
  530. const EM_EXLIMITTEXT =WM_USER+53
  531. const EM_EXLINEFROMCHAR =WM_USER+54
  532. const EM_EXSETSEL =WM_USER+55
  533. const EM_FINDTEXT =WM_USER+56
  534. const EM_FORMATRANGE =WM_USER+57
  535. const EM_GETCHARFORMAT =WM_USER+58
  536. const EM_GETEVENTMASK =WM_USER+59
  537. const EM_GETOLEINTERFACE =WM_USER+60
  538. const EM_GETPARAFORMAT =WM_USER+61
  539. const EM_GETSELTEXT =WM_USER+62
  540. const EM_HIDESELECTION =WM_USER+63
  541. const EM_PASTESPECIAL =WM_USER+64
  542. const EM_REQUESTRESIZE =WM_USER+65
  543. const EM_SELECTIONTYPE =WM_USER+66
  544. const EM_SETBKGNDCOLOR =WM_USER+67
  545. const EM_SETCHARFORMAT =WM_USER+68
  546. const EM_SETEVENTMASK =WM_USER+69
  547. const EM_SETOLECALLBACK =WM_USER+70
  548. const EM_SETPARAFORMAT =WM_USER+71
  549. const EM_SETTARGETDEVICE =WM_USER+72
  550. const EM_STREAMIN =WM_USER+73
  551. const EM_STREAMOUT =WM_USER+74
  552. const EM_GETTEXTRANGE =WM_USER+75
  553. const EM_FINDWORDBREAK =WM_USER+76
  554. const EM_SETOPTIONS =WM_USER+77
  555. const EM_GETOPTIONS =WM_USER+78
  556. const EM_FINDTEXTEX =WM_USER+79
  557. #ifdef _WIN32
  558. const EM_GETWORDBREAKPROCEX =WM_USER+80
  559. const EM_SETWORDBREAKPROCEX =WM_USER+81
  560. #endif
  561. ' RichEdit 2.0 messages
  562. const EM_SETUNDOLIMIT =WM_USER+82
  563. const EM_REDO =WM_USER+84
  564. const EM_CANREDO =WM_USER+85
  565. const EM_GETUNDONAME =WM_USER+86
  566. const EM_GETREDONAME =WM_USER+87
  567. const EM_STOPGROUPTYPING =WM_USER+88
  568. const EM_SETTEXTMODE =WM_USER+89
  569. const EM_GETTEXTMODE =WM_USER+90
  570. ' enum for use with EM_GET/SETTEXTMODE
  571. typedef enum tagTextMode
  572. {
  573. TM_PLAINTEXT =1,
  574. TM_RICHTEXT =2, ' Default behavior
  575. TM_SINGLELEVELUNDO =4,
  576. TM_MULTILEVELUNDO =8, ' Default behavior
  577. TM_SINGLECODEPAGE =16,
  578. TM_MULTICODEPAGE =32 ' Default behavior
  579. } TEXTMODE;
  580. const EM_AUTOURLDETECT =WM_USER+91
  581. const EM_GETAUTOURLDETECT =WM_USER+92
  582. const EM_SETPALETTE =WM_USER+93
  583. const EM_GETTEXTEX =WM_USER+94
  584. const EM_GETTEXTLENGTHEX =WM_USER+95
  585. const EM_SHOWSCROLLBAR =WM_USER+96
  586. const EM_SETTEXTEX =WM_USER+97
  587. ' East Asia specific messages
  588. const EM_SETPUNCTUATION =WM_USER+100
  589. const EM_GETPUNCTUATION =WM_USER+101
  590. const EM_SETWORDWRAPMODE =WM_USER+102
  591. const EM_GETWORDWRAPMODE =WM_USER+103
  592. const EM_SETIMECOLOR =WM_USER+104
  593. const EM_GETIMECOLOR =WM_USER+105
  594. const EM_SETIMEOPTIONS =WM_USER+106
  595. const EM_GETIMEOPTIONS =WM_USER+107
  596. const EM_CONVPOSITION =WM_USER+108
  597. const EM_SETLANGOPTIONS =WM_USER+120
  598. const EM_GETLANGOPTIONS =WM_USER+121
  599. const EM_GETIMECOMPMODE =WM_USER+122
  600. const EM_FINDTEXTW =WM_USER+123
  601. const EM_FINDTEXTEXW =WM_USER+124
  602. ' RE3.0 FE messages
  603. const EM_RECONVERSION =WM_USER+125
  604. const EM_SETIMEMODEBIAS =WM_USER+126
  605. const EM_GETIMEMODEBIAS =WM_USER+127
  606. ' BiDi specific messages
  607. const EM_SETBIDIOPTIONS =WM_USER+200
  608. const EM_GETBIDIOPTIONS =WM_USER+201
  609. const EM_SETTYPOGRAPHYOPTIONS =WM_USER+202
  610. const EM_GETTYPOGRAPHYOPTIONS =WM_USER+203
  611. ' Extended edit style specific messages
  612. const EM_SETEDITSTYLE =WM_USER+204
  613. const EM_GETEDITSTYLE =WM_USER+205
  614. ' Extended edit style masks
  615. const SES_EMULATESYSEDIT 1
  616. const SES_BEEPONMAXTEXT 2
  617. const SES_EXTENDBACKCOLOR 4
  618. const SES_MAPCPS 8
  619. const SES_EMULATE10 16
  620. const SES_USECRLF 32
  621. const SES_USEAIMM 64
  622. const SES_NOIME 128
  623. const SES_ALLOWBEEPS 256
  624. const SES_UPPERCASE 512
  625. const SES_LOWERCASE 1024
  626. const SES_NOINPUTSEQUENCECHK 2048
  627. const SES_BIDI 4096
  628. const SES_SCROLLONKILLFOCUS 8192
  629. const SES_XLTCRCRLFTOCR 16384
  630. const SES_DRAFTMODE 32768
  631. const SES_USECTF =$0010000
  632. const SES_HIDEGRIDLINES =$0020000
  633. const SES_USEATFONT =$0040000
  634. const SES_CUSTOMLOOK =$0080000
  635. const SES_LBSCROLLNOTIFY =$0100000
  636. const SES_CTFALLOWEMBED =$0200000
  637. const SES_CTFALLOWSMARTTAG =$0400000
  638. const SES_CTFALLOWPROOFING =$0800000
  639. ' Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS
  640. const IMF_AUTOKEYBOARD =$0001
  641. const IMF_AUTOFONT =$0002
  642. const IMF_IMECANCELCOMPLETE =$0004 ' High completes comp string when aborting, low cancels
  643. const IMF_IMEALWAYSSENDNOTIFY =$0008
  644. const IMF_AUTOFONTSIZEADJUST =$0010
  645. const IMF_UIFONTS =$0020
  646. const IMF_DUALFONT =$0080
  647. ' Values for EM_GETIMECOMPMODE
  648. const ICM_NOTOPEN =$0000
  649. const ICM_LEVEL3 =$0001
  650. const ICM_LEVEL2 =$0002
  651. const ICM_LEVEL2_5 =$0003
  652. const ICM_LEVEL2_SUI =$0004
  653. const ICM_CTF =$0005
  654. ' Options for EM_SETTYPOGRAPHYOPTIONS
  655. const TO_ADVANCEDTYPOGRAPHY 1
  656. const TO_SIMPLELINEBREAK 2
  657. const TO_DISABLECUSTOMTEXTOUT 4
  658. const TO_ADVANCEDLAYOUT 8
  659. ' Pegasus outline mode messages (RE 3.0
  660. ' Outline mode message
  661. const EM_OUTLINE=WM_USER+220
  662. ' Message for getting and restoring scroll pos
  663. const EM_GETSCROLLPOS =WM_USER+221
  664. const EM_SETSCROLLPOS =WM_USER+222
  665. ' Change fontsize in current selection by wParam
  666. const EM_SETFONTSIZE=WM_USER+223
  667. const EM_GETZOOM =WM_USER+224
  668. const EM_SETZOOM =WM_USER+225
  669. const EM_GETVIEWKIND =WM_USER+226
  670. const EM_SETVIEWKIND =WM_USER+227
  671. ' RichEdit 4.0 messages
  672. const EM_GETPAGE =WM_USER+228
  673. const EM_SETPAGE =WM_USER+229
  674. const EM_GETHYPHENATEINFO =WM_USER+230
  675. const EM_SETHYPHENATEINFO =WM_USER+231
  676. const EM_GETPAGEROTATE =WM_USER+235
  677. const EM_SETPAGEROTATE =WM_USER+236
  678. const EM_GETCTFMODEBIAS =WM_USER+237
  679. const EM_SETCTFMODEBIAS =WM_USER+238
  680. const EM_GETCTFOPENSTATUS =WM_USER+240
  681. const EM_SETCTFOPENSTATUS =WM_USER+241
  682. const EM_GETIMECOMPTEXT =WM_USER+242
  683. const EM_ISIME =WM_USER+243
  684. const EM_GETIMEPROPERTY =WM_USER+244
  685. ' These messages control what rich edit does when it comes accross
  686. ' OLE objects during RTF stream in.Normally rich edit queries the client
  687. ' application only after OleLoad has been called.With these messages it is possible to
  688. ' set the rich edit control to a mode where it will query the client application before
  689. ' OleLoad is called
  690. const EM_GETQUERYRTFOBJ =WM_USER+269
  691. const EM_SETQUERYRTFOBJ =WM_USER+270
  692. ' EM_SETPAGEROTATE wparam values
  693. const EPR_0 0 ' Text flows left to right and top to bottom
  694. const EPR_270 1 ' Text flows top to bottom and right to left
  695. const EPR_180 2 ' Text flows right to left and bottom to top
  696. const EPR_90 3 ' Text flows bottom to top and left to right
  697. ' EM_SETCTFMODEBIAS wparam values
  698. const CTFMODEBIAS_DEFAULT =$0000
  699. const CTFMODEBIAS_FILENAME =$0001
  700. const CTFMODEBIAS_NAME =$0002
  701. const CTFMODEBIAS_READING =$0003
  702. const CTFMODEBIAS_DATETIME =$0004
  703. const CTFMODEBIAS_CONVERSATION =$0005
  704. const CTFMODEBIAS_NUMERIC =$0006
  705. const CTFMODEBIAS_HIRAGANA =$0007
  706. const CTFMODEBIAS_KATAKANA =$0008
  707. const CTFMODEBIAS_HANGUL =$0009
  708. const CTFMODEBIAS_HALFWIDTHKATAKANA =$000A
  709. const CTFMODEBIAS_FULLWIDTHALPHANUMERIC =$000B
  710. const CTFMODEBIAS_HALFWIDTHALPHANUMERIC =$000C
  711. ' EM_SETIMEMODEBIAS lparam values
  712. const IMF_SMODE_PLAURALCLAUSE =$0001
  713. const IMF_SMODE_NONE =$0002
  714. ' EM_GETIMECOMPTEXT wparam structure
  715. typedef struct _imecomptext {
  716. LONG cb; ' count of bytes in the output buffer.
  717. DWORD flags; ' value specifying the composition string type.
  718. ' Currently only support ICT_RESULTREADSTR
  719. } IMECOMPTEXT;
  720. const ICT_RESULTREADSTR 1
  721. ' Outline mode wparam values
  722. const EMO_EXIT0 ' Enter normal mode,lparam ignored
  723. const EMO_ENTER 1 ' Enter outline mode, lparam ignored
  724. const EMO_PROMOTE 2 ' LOWORD(lparam ==0 ==>
  725. 'promoteto body-text
  726. ' LOWORD(lparam !=0 ==>
  727. 'promote/demote current selection
  728. 'by indicated number of levels
  729. const EMO_EXPAND3 ' HIWORD(lparam =EMO_EXPANDSELECTION
  730. '-> expands selection to level
  731. 'indicated in LOWORD(lparam
  732. 'LOWORD(lparam =-1/+1 corresponds
  733. 'to collapse/expand button presses
  734. 'in winword (other values are
  735. 'equivalent to having pressed these
  736. 'buttons more than once
  737. 'HIWORD(lparam =EMO_EXPANDDOCUMENT
  738. '-> expands whole document to
  739. 'indicated level
  740. const EMO_MOVESELECTION 4 ' LOWORD(lparam !=0 -> move current
  741. 'selection up/down by indicated amount
  742. const EMO_GETVIEWMODE 5 ' Returns VM_NORMAL or VM_OUTLINE
  743. ' EMO_EXPAND options
  744. const EMO_EXPANDSELECTION 0
  745. const EMO_EXPANDDOCUMENT1
  746. const VM_NORMAL 4 ' Agrees with RTF \viewkindN
  747. const VM_OUTLINE 2
  748. const VM_PAGE 9 ' Screen page view (not print layout
  749. ' New notifications
  750. const EN_MSGFILTER =$0700
  751. const EN_REQUESTRESIZE =$0701
  752. const EN_SELCHANGE =$0702
  753. const EN_DROPFILES =$0703
  754. const EN_PROTECTED =$0704
  755. const EN_CORRECTTEXT =$0705 ' PenWin specific
  756. const EN_STOPNOUNDO =$0706
  757. const EN_IMECHANGE =$0707 ' East Asia specific
  758. const EN_SAVECLIPBOARD =$0708
  759. const EN_OLEOPFAILED =$0709
  760. const EN_OBJECTPOSITIONS =$070a
  761. const EN_LINK =$070b
  762. const EN_DRAGDROPDONE =$070c
  763. const EN_PARAGRAPHEXPANDED =$070d
  764. const EN_PAGECHANGE =$070e
  765. const EN_LOWFIRTF =$070f
  766. const EN_ALIGNLTR =$0710 ' BiDi specific notification
  767. const EN_ALIGNRTL =$0711 ' BiDi specific notification
  768. ' Event notification masks
  769. const ENM_NONE =$00000000
  770. const ENM_CHANGE =$00000001
  771. const ENM_UPDATE =$00000002
  772. const ENM_SCROLL =$00000004
  773. const ENM_SCROLLEVENTS =$00000008
  774. const ENM_DRAGDROPDONE =$00000010
  775. const ENM_PARAGRAPHEXPANDED =$00000020
  776. const ENM_PAGECHANGE =$00000040
  777. const ENM_KEYEVENTS =$00010000
  778. const ENM_MOUSEEVENTS =$00020000
  779. const ENM_REQUESTRESIZE =$00040000
  780. const ENM_SELCHANGE =$00080000
  781. const ENM_DROPFILES =$00100000
  782. const ENM_PROTECTED =$00200000
  783. const ENM_CORRECTTEXT =$00400000 ' PenWin specific
  784. const ENM_IMECHANGE =$00800000 ' Used by RE1.0 compatibility
  785. const ENM_LANGCHANGE =$01000000
  786. const ENM_OBJECTPOSITIONS =$02000000
  787. const ENM_LINK =$04000000
  788. const ENM_LOWFIRTF =$08000000
  789. ' New edit control styles
  790. const ES_SAVESEL =$00008000
  791. const ES_SUNKEN =$00004000
  792. const ES_DISABLENOSCROLL =$00002000
  793. ' Same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value
  794. const ES_SELECTIONBAR =$01000000
  795. ' Same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop
  796. const ES_NOOLEDRAGDROP =$00000008
  797. ' New edit control extended style
  798. #if (_WIN32_WINNT > =$0400 || (WINVER > =$0400
  799. const ES_EX_NOCALLOLEINIT =$00000000 ' Not supported in RE 2.0/3.0
  800. #else
  801. #ifdef _WIN32
  802. const ES_EX_NOCALLOLEINIT =$01000000
  803. #endif
  804. #endif
  805. ' These flags are used in FE Windows
  806. const ES_VERTICAL =$00400000 ' Not supported in RE 2.0/3.0
  807. const ES_NOIME =$00080000
  808. const ES_SELFIME =$00040000
  809. ' Edit control options
  810. const ECO_AUTOWORDSELECTION =$00000001
  811. const ECO_AUTOVSCROLL =$00000040
  812. const ECO_AUTOHSCROLL =$00000080
  813. const ECO_NOHIDESEL =$00000100
  814. const ECO_READONLY =$00000800
  815. const ECO_WANTRETURN =$00001000
  816. const ECO_SAVESEL =$00008000
  817. const ECO_SELECTIONBAR =$01000000
  818. const ECO_VERTICAL =$00400000 ' FE specific
  819. ' ECO operations
  820. const ECOOP_SET =$0001
  821. const ECOOP_OR =$0002
  822. const ECOOP_AND =$0003
  823. const ECOOP_XOR =$0004
  824. ' New word break function actions
  825. const WB_CLASSIFY 3
  826. const WB_MOVEWORDLEFT 4
  827. const WB_MOVEWORDRIGHT 5
  828. const WB_LEFTBREAK 6
  829. const WB_RIGHTBREAK 7
  830. ' East Asia specific flags
  831. const WB_MOVEWORDPREV 4
  832. const WB_MOVEWORDNEXT 5
  833. const WB_PREVBREAK 6
  834. const WB_NEXTBREAK 7
  835. const PC_FOLLOWING 1
  836. const PC_LEADING 2
  837. const PC_OVERFLOW 3
  838. const PC_DELIMITER 4
  839. const WBF_WORDWRAP =$010
  840. const WBF_WORDBREAK =$020
  841. const WBF_OVERFLOW =$040
  842. const WBF_LEVEL1 =$080
  843. const WBF_LEVEL2 =$100
  844. const WBF_CUSTOM =$200
  845. ' East Asia specific flags
  846. const IMF_FORCENONE =$0001
  847. const IMF_FORCEENABLE =$0002
  848. const IMF_FORCEDISABLE=$0004
  849. const IMF_CLOSESTATUSWINDOW =$0008
  850. const IMF_VERTICAL=$0020
  851. const IMF_FORCEACTIVE =$0040
  852. const IMF_FORCEINACTIVE =$0080
  853. const IMF_FORCEREMEMBER =$0100
  854. const IMF_MULTIPLEEDIT=$0400
  855. ' Word break flags (used with WB_CLASSIFY
  856. const WBF_CLASS ((BYTE =$0F
  857. const WBF_ISWHITE ((BYTE =$10
  858. const WBF_BREAKLINE ((BYTE =$20
  859. const WBF_BREAKAFTER ((BYTE =$40
  860. ' Data types
  861. #ifdef _WIN32
  862. ' Extended edit word break proc (character set aware
  863. typedef LONG (*EDITWORDBREAKPROCEX(char *pchText, LONG cchText, BYTE bCharSet, INT action;
  864. #endif
  865. ' All character format measurements are in twips
  866. typedef struct _charformat
  867. {
  868. UINT cbSize;
  869. DWORD dwMask;
  870. DWORD dwEffects;
  871. LONG yHeight;
  872. LONG yOffset;
  873. COLORREF crTextColor;
  874. BYTE bCharSet;
  875. BYTE bPitchAndFamily;
  876. char szFaceName[LF_FACESIZE];
  877. } CHARFORMATA;
  878. typedef struct _charformatw
  879. {
  880. UINT cbSize;
  881. DWORD dwMask;
  882. DWORD dwEffects;
  883. LONG yHeight;
  884. LONG yOffset;
  885. COLORREF crTextColor;
  886. BYTE bCharSet;
  887. BYTE bPitchAndFamily;
  888. WCHAR szFaceName[LF_FACESIZE];
  889. } CHARFORMATW;
  890. #if (_RICHEDIT_VER >==$0200
  891. #ifdef UNICODE
  892. const CHARFORMAT CHARFORMATW
  893. #else
  894. const CHARFORMAT CHARFORMATA
  895. #endif ' UNICODE
  896. #else
  897. const CHARFORMAT CHARFORMATA
  898. #endif ' _RICHEDIT_VER >==$0200
  899. ' CHARFORMAT2 structure
  900. #ifdef __cplusplus
  901. struct CHARFORMAT2W : _charformatw
  902. {
  903. WORD wWeight; ' Font weight (LOGFONT value
  904. SHORT sSpacing; ' Amount to space between letters
  905. COLORREF crBackColor; ' Background color
  906. LCID lcid; ' Locale ID
  907. DWORD dwReserved; ' Reserved. Must be 0
  908. SHORT sStyle; ' Style handle
  909. WORD wKerning; ' Twip size above which to kern char pair
  910. BYTE bUnderlineType; ' Underline type
  911. BYTE bAnimation; ' Animated text like marching ants
  912. BYTE bRevAuthor; ' Revision author index
  913. };
  914. struct CHARFORMAT2A : _charformat
  915. {
  916. WORD wWeight; ' Font weight (LOGFONT value
  917. SHORT sSpacing; ' Amount to space between letters
  918. COLORREF crBackColor; ' Background color
  919. LCID lcid; ' Locale ID
  920. DWORD dwReserved; ' Reserved. Must be 0
  921. SHORT sStyle; ' Style handle
  922. WORD wKerning; ' Twip size above which to kern char pair
  923. BYTE bUnderlineType; ' Underline type
  924. BYTE bAnimation; ' Animated text like marching ants
  925. BYTE bRevAuthor; ' Revision author index
  926. };
  927. #else ' regular C-style
  928. typedef struct _charformat2w
  929. {
  930. UINT cbSize;
  931. DWORD dwMask;
  932. DWORD dwEffects;
  933. LONG yHeight;
  934. LONG yOffset; ' > 0 for superscript, < 0 for subscript
  935. COLORREF crTextColor;
  936. BYTE bCharSet;
  937. BYTE bPitchAndFamily;
  938. WCHAR szFaceName[LF_FACESIZE];
  939. WORD wWeight; ' Font weight (LOGFONT value
  940. SHORT sSpacing; ' Amount to space between letters
  941. COLORREF crBackColor; ' Background color
  942. LCID lcid; ' Locale ID
  943. DWORD dwReserved; ' Reserved. Must be 0
  944. SHORT sStyle; ' Style handle
  945. WORD wKerning; ' Twip size above which to kern char pair
  946. BYTE bUnderlineType; ' Underline type
  947. BYTE bAnimation; ' Animated text like marching ants
  948. BYTE bRevAuthor; ' Revision author index
  949. BYTE bReserved1;
  950. } CHARFORMAT2W;
  951. typedef struct _charformat2a
  952. {
  953. UINT cbSize;
  954. DWORD dwMask;
  955. DWORD dwEffects;
  956. LONG yHeight;
  957. LONG yOffset; ' > 0 for superscript, < 0 for subscript
  958. COLORREF crTextColor;
  959. BYTE bCharSet;
  960. BYTE bPitchAndFamily;
  961. char szFaceName[LF_FACESIZE];
  962. WORD wWeight; ' Font weight (LOGFONT value
  963. SHORT sSpacing; ' Amount to space between letters
  964. COLORREF crBackColor; ' Background color
  965. LCID lcid; ' Locale ID
  966. DWORD dwReserved; ' Reserved. Must be 0
  967. SHORT sStyle; ' Style handle
  968. WORD wKerning; ' Twip size above which to kern char pair
  969. BYTE bUnderlineType; ' Underline type
  970. BYTE bAnimation; ' Animated text like marching ants
  971. BYTE bRevAuthor; ' Revision author index
  972. } CHARFORMAT2A;
  973. #endif ' C++
  974. #ifdef UNICODE
  975. const CHARFORMAT2 CHARFORMAT2W
  976. #else
  977. const CHARFORMAT2 CHARFORMAT2A
  978. #endif
  979. const CHARFORMATDELTA (sizeof(CHARFORMAT2 - sizeof(CHARFORMAT
  980. ' CFM_COLOR mirrors CFE_AUTOCOLOR, a little hack to easily deal with autocolor
  981. ' CHARFORMAT masks
  982. const CFM_BOLD =$00000001
  983. const CFM_ITALIC =$00000002
  984. const CFM_UNDERLINE =$00000004
  985. const CFM_STRIKEOUT =$00000008
  986. const CFM_PROTECTED =$00000010
  987. const CFM_LINK =$00000020 ' Exchange hyperlink extension
  988. const CFM_SIZE =$80000000
  989. const CFM_COLOR =$40000000
  990. const CFM_FACE =$20000000
  991. const CFM_OFFSET =$10000000
  992. const CFM_CHARSET =$08000000
  993. ' CHARFORMAT effects
  994. const CFE_BOLD =$0001
  995. const CFE_ITALIC =$0002
  996. const CFE_UNDERLINE =$0004
  997. const CFE_STRIKEOUT =$0008
  998. const CFE_PROTECTED =$0010
  999. const CFE_LINK =$0020
  1000. const CFE_AUTOCOLOR =$40000000 ' NOTE: this corresponds to
  1001. ' CFM_COLOR, which controls it
  1002. ' Masks and effects defined for CHARFORMAT2 -- an (* indicates
  1003. ' that the data is stored by RichEdit 2.0/3.0, but not displayed
  1004. const CFM_SMALLCAPS =$0040 ' (*
  1005. const CFM_ALLCAPS =$0080 ' Displayed by 3.0
  1006. const CFM_HIDDEN =$0100 ' Hidden by 3.0
  1007. const CFM_OUTLINE =$0200 ' (*
  1008. const CFM_SHADOW =$0400 ' (*
  1009. const CFM_EMBOSS =$0800 ' (*
  1010. const CFM_IMPRINT =$1000 ' (*
  1011. const CFM_DISABLED =$2000
  1012. const CFM_REVISED =$4000
  1013. const CFM_BACKCOLOR =$04000000
  1014. const CFM_LCID =$02000000
  1015. const CFM_UNDERLINETYPE =$00800000 ' Many displayed by 3.0
  1016. const CFM_WEIGHT =$00400000
  1017. const CFM_SPACING =$00200000 ' Displayed by 3.0
  1018. const CFM_KERNING =$00100000 ' (*
  1019. const CFM_STYLE =$00080000 ' (*
  1020. const CFM_ANIMATION =$00040000 ' (*
  1021. const CFM_REVAUTHOR =$00008000
  1022. const CFE_SUBSCRIPT =$00010000 ' Superscript and subscript are
  1023. const CFE_SUPERSCRIPT =$00020000 'mutually exclusive
  1024. const CFM_SUBSCRIPT CFE_SUBSCRIPT | CFE_SUPERSCRIPT
  1025. const CFM_SUPERSCRIPT CFM_SUBSCRIPT
  1026. ' CHARFORMAT "ALL" masks
  1027. const CFM_EFFECTS (CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | \
  1028. CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK
  1029. const CFM_ALL (CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET
  1030. const CFM_EFFECTS2 (CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS \
  1031. | CFM_HIDDEN| CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS \
  1032. | CFM_IMPRINT | CFM_DISABLED | CFM_REVISED \
  1033. | CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR
  1034. const CFM_ALL2 (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID \
  1035. | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR \
  1036. | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION
  1037. const CFE_SMALLCAPS CFM_SMALLCAPS
  1038. const CFE_ALLCAPS CFM_ALLCAPS
  1039. const CFE_HIDDEN CFM_HIDDEN
  1040. const CFE_OUTLINE CFM_OUTLINE
  1041. const CFE_SHADOW CFM_SHADOW
  1042. const CFE_EMBOSS CFM_EMBOSS
  1043. const CFE_IMPRINT CFM_IMPRINT
  1044. const CFE_DISABLED CFM_DISABLED
  1045. const CFE_REVISED CFM_REVISED
  1046. ' CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and
  1047. ' CFM_BACKCOLOR, respectively, which control them
  1048. const CFE_AUTOBACKCOLOR CFM_BACKCOLOR
  1049. ' Underline types. RE 1.0 displays only CFU_UNDERLINE
  1050. const CFU_CF1UNDERLINE =$FF ' Map charformat's bit underline to CF2
  1051. const CFU_INVERT =$FE ' For IME composition fake a selection
  1052. const CFU_UNDERLINETHICKLONGDASH 18 ' (* display as dash
  1053. const CFU_UNDERLINETHICKDOTTED 17 ' (* display as dot
  1054. const CFU_UNDERLINETHICKDASHDOTDOT 16 ' (* display as dash dot dot
  1055. const CFU_UNDERLINETHICKDASHDOT 15 ' (* display as dash dot
  1056. const CFU_UNDERLINETHICKDASH 14 ' (* display as dash
  1057. const CFU_UNDERLINELONGDASH 13 ' (* display as dash
  1058. const CFU_UNDERLINEHEAVYWAVE 12 ' (* display as wave
  1059. const CFU_UNDERLINEDOUBLEWAVE 11 ' (* display as wave
  1060. const CFU_UNDERLINEHAIRLINE 10 ' (* display as single
  1061. const CFU_UNDERLINETHICK 9
  1062. const CFU_UNDERLINEWAVE 8
  1063. const CFU_UNDERLINEDASHDOTDOT 7
  1064. const CFU_UNDERLINEDASHDOT 6
  1065. const CFU_UNDERLINEDASH 5
  1066. const CFU_UNDERLINEDOTTED 4
  1067. const CFU_UNDERLINEDOUBLE 3 ' (* display as single
  1068. const CFU_UNDERLINEWORD 2 ' (* display as single
  1069. const CFU_UNDERLINE 1
  1070. const CFU_UNDERLINENONE 0
  1071. const yHeightCharPtsMost 1638
  1072. ' EM_SETCHARFORMAT wParam masks
  1073. const SCF_SELECTION =$0001
  1074. const SCF_WORD =$0002
  1075. const SCF_DEFAULT =$0000 ' Set default charformat or paraformat
  1076. const SCF_ALL =$0004 ' Not valid with SCF_SELECTION or SCF_WORD
  1077. const SCF_USEUIRULES =$0008 ' Modifier for SCF_SELECTION; says that
  1078. 'format came from a toolbar, etc., and
  1079. 'hence UI formatting rules should be
  1080. 'used instead of literal formatting
  1081. const SCF_ASSOCIATEFONT =$0010 ' Associate fontname with bCharSet (one
  1082. 'possible for each of Western, ME, FE,
  1083. 'Thai
  1084. const SCF_NOKBUPDATE =$0020 ' Do not update KB layput for this change
  1085. 'even if autokeyboard is on
  1086. const SCF_ASSOCIATEFONT2 =$0040 ' Associate plane-2 (surrogate font
  1087. typedef struct _charrange
  1088. {
  1089. LONG cpMin;
  1090. LONG cpMax;
  1091. } CHARRANGE;
  1092. typedef struct _textrange
  1093. {
  1094. CHARRANGE chrg;
  1095. LPSTR lpstrText; ' Allocated by caller, zero terminated by RichEdit
  1096. } TEXTRANGEA;
  1097. typedef struct _textrangew
  1098. {
  1099. CHARRANGE chrg;
  1100. LPWSTR lpstrText; ' Allocated by caller, zero terminated by RichEdit
  1101. } TEXTRANGEW;
  1102. #if (_RICHEDIT_VER >==$0200
  1103. #ifdef UNICODE
  1104. const TEXTRANGE TEXTRANGEW
  1105. #else
  1106. const TEXTRANGE TEXTRANGEA
  1107. #endif ' UNICODE
  1108. #else
  1109. const TEXTRANGE TEXTRANGEA
  1110. #endif ' _RICHEDIT_VER >==$0200
  1111. typedef DWORD (CALLBACK *EDITSTREAMCALLBACK(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb;
  1112. typedef struct _editstream
  1113. {
  1114. DWORD_PTR dwCookie; ' User value passed to callback as first parameter
  1115. DWORD dwError; ' Last error
  1116. EDITSTREAMCALLBACK pfnCallback;
  1117. } EDITSTREAM;
  1118. ' Stream formats. Flags are all in low word, since high word
  1119. ' gives possible codepage choice.
  1120. const SF_TEXT =$0001
  1121. const SF_RTF =$0002
  1122. const SF_RTFNOOBJS =$0003 ' Write only
  1123. const SF_TEXTIZED =$0004 ' Write only
  1124. const SF_UNICODE =$0010 ' Unicode file (UCS2 little endian
  1125. const SF_USECODEPAGE =$0020 ' CodePage given by high word
  1126. const SF_NCRFORNONASCII =$40 ' Output /uN for nonASCII
  1127. const SFF_WRITEXTRAPAR=$80 ' Output \par at end
  1128. ' Flag telling stream operations to operate on selection only
  1129. ' EM_STREAMINreplaces current selection
  1130. ' EM_STREAMOUT streams out current selection
  1131. const SFF_SELECTION =$8000
  1132. ' Flag telling stream operations to ignore some FE control words
  1133. ' having to do with FE word breaking and horiz vs vertical text.
  1134. ' Not used in RichEdit 2.0 and later
  1135. const SFF_PLAINRTF =$4000
  1136. ' Flag telling file stream output (SFF_SELECTION flag not set to persist
  1137. ' \viewscaleN control word.
  1138. const SFF_PERSISTVIEWSCALE =$2000
  1139. ' Flag telling file stream input with SFF_SELECTION flag not set not to
  1140. ' close the document
  1141. const SFF_KEEPDOCINFO =$1000
  1142. ' Flag telling stream operations to output in Pocket Word format
  1143. const SFF_PWD =$0800
  1144. ' 3-bit field specifying the value of N - 1 to use for \rtfN or \pwdN
  1145. const SF_RTFVAL =$0700
  1146. typedef struct _findtext
  1147. {
  1148. CHARRANGE chrg;
  1149. LPCSTR lpstrText;
  1150. } FINDTEXTA;
  1151. typedef struct _findtextw
  1152. {
  1153. CHARRANGE chrg;
  1154. LPCWSTR lpstrText;
  1155. } FINDTEXTW;
  1156. #if (_RICHEDIT_VER >==$0200
  1157. #ifdef UNICODE
  1158. const FINDTEXT FINDTEXTW
  1159. #else
  1160. const FINDTEXT FINDTEXTA
  1161. #endif ' UNICODE
  1162. #else
  1163. const FINDTEXT FINDTEXTA
  1164. #endif ' _RICHEDIT_VER >==$0200
  1165. typedef struct _findtextexa
  1166. {
  1167. CHARRANGE chrg;
  1168. LPCSTR lpstrText;
  1169. CHARRANGE chrgText;
  1170. } FINDTEXTEXA;
  1171. typedef struct _findtextexw
  1172. {
  1173. CHARRANGE chrg;
  1174. LPCWSTR lpstrText;
  1175. CHARRANGE chrgText;
  1176. } FINDTEXTEXW;
  1177. #if (_RICHEDIT_VER >==$0200
  1178. #ifdef UNICODE
  1179. const FINDTEXTEX FINDTEXTEXW
  1180. #else
  1181. const FINDTEXTEX FINDTEXTEXA
  1182. #endif ' UNICODE
  1183. #else
  1184. const FINDTEXTEX FINDTEXTEXA
  1185. #endif ' _RICHEDIT_VER >==$0200
  1186. typedef struct _formatrange
  1187. {
  1188. HDC hdc;
  1189. HDC hdcTarget;
  1190. RECT rc;
  1191. RECT rcPage;
  1192. CHARRANGE chrg;
  1193. } FORMATRANGE;
  1194. ' All paragraph measurements are in twips
  1195. const MAX_TAB_STOPS 32
  1196. const lDefaultTab 720
  1197. const MAX_TABLE_CELLS 63
  1198. ' This is a hack to make PARAFORMAT compatible with RE 1.0
  1199. const wReserved wEffects
  1200. typedef struct _paraformat
  1201. {
  1202. UINT cbSize;
  1203. DWORD dwMask;
  1204. WORD wNumbering;
  1205. WORD wEffects;
  1206. LONG dxStartIndent;
  1207. LONG dxRightIndent;
  1208. LONG dxOffset;
  1209. WORD wAlignment;
  1210. SHORT cTabCount;
  1211. LONG rgxTabs[MAX_TAB_STOPS];
  1212. } PARAFORMAT;
  1213. #ifdef __cplusplus
  1214. struct PARAFORMAT2 : _paraformat
  1215. {
  1216. LONG dySpaceBefore; ' Vertical spacing before para
  1217. LONG dySpaceAfter; ' Vertical spacing after para
  1218. LONG dyLineSpacing; ' Line spacing depending on Rule
  1219. SHORT sStyle; ' Style handle
  1220. BYTE bLineSpacingRule; ' Rule for line spacing (see tom.doc
  1221. BYTE bOutlineLevel; ' Outline level
  1222. WORD wShadingWeight; ' Shading in hundredths of a per cent
  1223. WORD wShadingStyle; ' Nibble 0: style, 1: cfpat, 2: cbpat
  1224. WORD wNumberingStart; ' Starting value for numbering
  1225. WORD wNumberingStyle; ' Alignment, roman/arabic, (, , ., etc.
  1226. WORD wNumberingTab; ' Space bet FirstIndent & 1st-line text
  1227. WORD wBorderSpace; ' Border-text spaces (nbl/bdr in pts
  1228. WORD wBorderWidth; ' Pen widths (nbl/bdr in half pts
  1229. WORD wBorders; ' Border styles (nibble/border
  1230. };
  1231. #else ' Regular C-style
  1232. typedef struct _paraformat2
  1233. {
  1234. UINT cbSize;
  1235. DWORD dwMask;
  1236. WORD wNumbering;
  1237. WORD wReserved;
  1238. LONG dxStartIndent;
  1239. LONG dxRightIndent;
  1240. LONG dxOffset;
  1241. WORD wAlignment;
  1242. SHORT cTabCount;
  1243. LONG rgxTabs[MAX_TAB_STOPS];
  1244. LONG dySpaceBefore; ' Vertical spacing before para
  1245. LONG dySpaceAfter; ' Vertical spacing after para
  1246. LONG dyLineSpacing; ' Line spacing depending on Rule
  1247. SHORT sStyle; ' Style handle
  1248. BYTE bLineSpacingRule; ' Rule for line spacing (see tom.doc
  1249. BYTE bOutlineLevel; ' Outline Level
  1250. WORD wShadingWeight; ' Shading in hundredths of a per cent
  1251. WORD wShadingStyle; ' Byte 0: style, nib 2: cfpat, 3: cbpat
  1252. WORD wNumberingStart; ' Starting value for numbering
  1253. WORD wNumberingStyle; ' Alignment, Roman/Arabic, (, , ., etc.
  1254. WORD wNumberingTab; ' Space bet 1st indent and 1st-line text
  1255. WORD wBorderSpace; ' Border-text spaces (nbl/bdr in pts
  1256. WORD wBorderWidth; ' Pen widths (nbl/bdr in half twips
  1257. WORD wBorders; ' Border styles (nibble/border
  1258. } PARAFORMAT2;
  1259. #endif ' C++
  1260. ' PARAFORMAT mask values
  1261. const PFM_STARTINDENT =$00000001
  1262. const PFM_RIGHTINDENT =$00000002
  1263. const PFM_OFFSET =$00000004
  1264. const PFM_ALIGNMENT =$00000008
  1265. const PFM_TABSTOPS =$00000010
  1266. const PFM_NUMBERING =$00000020
  1267. const PFM_OFFSETINDENT =$80000000
  1268. ' PARAFORMAT 2.0 masks and effects
  1269. const PFM_SPACEBEFORE =$00000040
  1270. const PFM_SPACEAFTER =$00000080
  1271. const PFM_LINESPACING =$00000100
  1272. const PFM_STYLE =$00000400
  1273. const PFM_BORDER =$00000800 ' (*
  1274. const PFM_SHADING =$00001000 ' (*
  1275. const PFM_NUMBERINGSTYLE =$00002000 ' RE 3.0
  1276. const PFM_NUMBERINGTAB =$00004000 ' RE 3.0
  1277. const PFM_NUMBERINGSTART =$00008000 ' RE 3.0
  1278. const PFM_RTLPARA =$00010000
  1279. const PFM_KEEP =$00020000 ' (*
  1280. const PFM_KEEPNEXT =$00040000 ' (*
  1281. const PFM_PAGEBREAKBEFORE =$00080000 ' (*
  1282. const PFM_NOLINENUMBER =$00100000 ' (*
  1283. const PFM_NOWIDOWCONTROL =$00200000 ' (*
  1284. const PFM_DONOTHYPHEN =$00400000 ' (*
  1285. const PFM_SIDEBYSIDE =$00800000 ' (*
  1286. const PFM_TABLE =$40000000 ' RE 3.0
  1287. const PFM_TEXTWRAPPINGBREAK =$20000000 ' RE 3.0
  1288. const PFM_TABLEROWDELIMITER =$10000000 ' RE 4.0
  1289. ' The following three properties are read only
  1290. const PFM_COLLAPSED =$01000000 ' RE 3.0
  1291. const PFM_OUTLINELEVEL =$02000000 ' RE 3.0
  1292. const PFM_BOX =$04000000 ' RE 3.0
  1293. const PFM_RESERVED2 =$08000000 ' RE 4.0
  1294. ' PARAFORMAT "ALL" masks
  1295. const PFM_ALL (PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | \
  1296. PFM_ALIGNMENT | PFM_TABSTOPS| PFM_NUMBERING | \
  1297. PFM_OFFSETINDENT| PFM_RTLPARA
  1298. ' Note: PARAFORMAT has no effects (BiDi RichEdit 1.0 does have PFE_RTLPARA
  1299. const PFM_EFFECTS (PFM_RTLPARA | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE \
  1300. | PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER\
  1301. | PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE \
  1302. | PFM_TABLE | PFM_TABLEROWDELIMITER
  1303. const PFM_ALL2 (PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER \
  1304. | PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER \
  1305. | PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE
  1306. const PFE_RTLPARA (PFM_RTLPARA >> 16
  1307. const PFE_KEEP (PFM_KEEP >> 16 ' (*
  1308. const PFE_KEEPNEXT (PFM_KEEPNEXT >> 16 ' (*
  1309. const PFE_PAGEBREAKBEFORE (PFM_PAGEBREAKBEFORE >> 16 ' (*
  1310. const PFE_NOLINENUMBER (PFM_NOLINENUMBER >> 16 ' (*
  1311. const PFE_NOWIDOWCONTROL (PFM_NOWIDOWCONTROL >> 16 ' (*
  1312. const PFE_DONOTHYPHEN (PFM_DONOTHYPHEN >> 16 ' (*
  1313. const PFE_SIDEBYSIDE (PFM_SIDEBYSIDE >> 16 ' (*
  1314. const PFE_TEXTWRAPPINGBREAK (PFM_TEXTWRAPPINGBREAK>>16 ' (*
  1315. ' The following four effects are read only
  1316. const PFE_COLLAPSED (PFM_COLLAPSED >> 16 ' (+
  1317. const PFE_BOX (PFM_BOX >> 16 ' (+
  1318. const PFE_TABLE (PFM_TABLE >> 16 ' Inside table row. RE 3.0
  1319. const PFE_TABLEROWDELIMITER (PFM_TABLEROWDELIMITER>>16 ' Table row start. RE 4.0
  1320. ' PARAFORMAT numbering options
  1321. const PFN_BULLET 1 ' tomListBullet
  1322. ' PARAFORMAT2 wNumbering options
  1323. const PFN_ARABIC 2 ' tomListNumberAsArabic: 0, 1, 2, ...
  1324. const PFN_LCLETTER 3 ' tomListNumberAsLCLetter: a, b, c, ...
  1325. const PFN_UCLETTER 4 ' tomListNumberAsUCLetter: A, B, C, ...
  1326. const PFN_LCROMAN 5 ' tomListNumberAsLCRoman:i, ii, iii, ...
  1327. const PFN_UCROMAN 6 ' tomListNumberAsUCRoman:I, II, III, ...
  1328. ' PARAFORMAT2 wNumberingStyle options
  1329. const PFNS_PAREN =$000 ' default, e.g., 1
  1330. const PFNS_PARENS =$100 ' tomListParentheses/256, e.g., (1
  1331. const PFNS_PERIOD =$200 ' tomListPeriod/256, e.g., 1.
  1332. const PFNS_PLAIN =$300 ' tomListPlain/256, e.g., 1
  1333. const PFNS_NONUMBER =$400 ' Used for continuation w/o number
  1334. const PFNS_NEWNUMBER =$8000 ' Start new number with wNumberingStart
  1335. ' (can be combined with other PFNS_xxx
  1336. ' PARAFORMAT alignment options
  1337. const PFA_LEFT 1
  1338. const PFA_RIGHT 2
  1339. const PFA_CENTER 3
  1340. ' PARAFORMAT2 alignment options
  1341. const PFA_JUSTIFY 4 ' New paragraph-alignment option 2.0 (*
  1342. const PFA_FULL_INTERWORD 4 ' These are supported in 3.0 with advanced
  1343. const PFA_FULL_INTERLETTER 5 'typography enabled
  1344. const PFA_FULL_SCALED 6
  1345. const PFA_FULL_GLYPHS 7
  1346. const PFA_SNAP_GRID 8
  1347. ' Notification structures
  1348. #ifndef WM_NOTIFY
  1349. const WM_NOTIFY =$004E
  1350. typedef struct _nmhdr
  1351. {
  1352. HWND hwndFrom;
  1353. UINT idFrom;
  1354. UINT code;
  1355. } NMHDR;
  1356. #endif' !WM_NOTIFY
  1357. typedef struct _msgfilter
  1358. {
  1359. NMHDR nmhdr;
  1360. UINT msg;
  1361. WPARAM wParam;
  1362. LPARAM lParam;
  1363. } MSGFILTER;
  1364. typedef struct _reqresize
  1365. {
  1366. NMHDR nmhdr;
  1367. RECT rc;
  1368. } REQRESIZE;
  1369. typedef struct _selchange
  1370. {
  1371. NMHDR nmhdr;
  1372. CHARRANGE chrg;
  1373. WORD seltyp;
  1374. } SELCHANGE;
  1375. const SEL_EMPTY =$0000
  1376. const SEL_TEXT =$0001
  1377. const SEL_OBJECT =$0002
  1378. const SEL_MULTICHAR =$0004
  1379. const SEL_MULTIOBJECT =$0008
  1380. ' Used with IRichEditOleCallback::GetContextMenu, this flag will be
  1381. ' passed as a "selection type".It indicates that a context menu for
  1382. ' a right-mouse drag drop should be generated.The IOleObject parameter
  1383. ' will really be the IDataObject for the drop
  1384. const GCM_RIGHTMOUSEDROP=$8000
  1385. typedef struct _endropfiles
  1386. {
  1387. NMHDR nmhdr;
  1388. HANDLE hDrop;
  1389. LONG cp;
  1390. BOOL fProtected;
  1391. } ENDROPFILES;
  1392. typedef struct _enprotected
  1393. {
  1394. NMHDR nmhdr;
  1395. UINT msg;
  1396. WPARAM wParam;
  1397. LPARAM lParam;
  1398. CHARRANGE chrg;
  1399. } ENPROTECTED;
  1400. typedef struct _ensaveclipboard
  1401. {
  1402. NMHDR nmhdr;
  1403. LONG cObjectCount;
  1404. LONG cch;
  1405. } ENSAVECLIPBOARD;
  1406. #ifndef MACPORT
  1407. typedef struct _enoleopfailed
  1408. {
  1409. NMHDR nmhdr;
  1410. LONG iob;
  1411. LONG lOper;
  1412. HRESULT hr;
  1413. } ENOLEOPFAILED;
  1414. #endif
  1415. const OLEOP_DOVERB 1
  1416. typedef struct _objectpositions
  1417. {
  1418. NMHDR nmhdr;
  1419. LONG cObjectCount;
  1420. LONG *pcpPositions;
  1421. } OBJECTPOSITIONS;
  1422. typedef struct _enlink
  1423. {
  1424. NMHDR nmhdr;
  1425. UINT msg;
  1426. WPARAM wParam;
  1427. LPARAM lParam;
  1428. CHARRANGE chrg;
  1429. } ENLINK;
  1430. typedef struct _enlowfirtf
  1431. {
  1432. NMHDR nmhdr;
  1433. char *szControl;
  1434. } ENLOWFIRTF;
  1435. ' PenWin specific
  1436. typedef struct _encorrecttext
  1437. {
  1438. NMHDR nmhdr;
  1439. CHARRANGE chrg;
  1440. WORD seltyp;
  1441. } ENCORRECTTEXT;
  1442. ' East Asia specific
  1443. typedef struct _punctuation
  1444. {
  1445. UINT iSize;
  1446. LPSTR szPunctuation;
  1447. } PUNCTUATION;
  1448. ' East Asia specific
  1449. typedef struct _compcolor
  1450. {
  1451. COLORREF crText;
  1452. COLORREF crBackground;
  1453. DWORD dwEffects;
  1454. }COMPCOLOR;
  1455. ' Clipboard formats - use as parameter to RegisterClipboardFormat(
  1456. const CF_RTF TEXT("Rich Text Format"
  1457. const CF_RTFNOOBJS TEXT("Rich Text Format Without Objects"
  1458. const CF_RETEXTOBJ TEXT("RichEdit Text and Objects"
  1459. ' Paste Special
  1460. typedef struct _repastespecial
  1461. {
  1462. DWORD dwAspect;
  1463. DWORD_PTR dwParam;
  1464. } REPASTESPECIAL;
  1465. ' UndoName info
  1466. typedef enum _undonameid
  1467. {
  1468. UID_UNKNOWN =0,
  1469. UID_TYPING =1,
  1470. UID_DELETE =2,
  1471. UID_DRAGDROP =3,
  1472. UID_CUT =4,
  1473. UID_PASTE =5,
  1474. UID_AUTOCORRECT =6
  1475. } UNDONAMEID;
  1476. ' Flags for the SETEXTEX data structure
  1477. const ST_DEFAULT 0
  1478. const ST_KEEPUNDO 1
  1479. const ST_SELECTION 2
  1480. const ST_NEWCHARS 4
  1481. ' EM_SETTEXTEX info; this struct is passed in the wparam of the message
  1482. typedef struct _settextex
  1483. {
  1484. DWORD flags; ' Flags (see the ST_XXX defines
  1485. UINT codepage; ' Code page for translation (CP_ACP for sys default,
  1486. '1200 for Unicode, -1 for control default
  1487. } SETTEXTEX;
  1488. ' Flags for the GETEXTEX data structure
  1489. const GT_DEFAULT 0
  1490. const GT_USECRLF 1
  1491. const GT_SELECTION 2
  1492. const GT_RAWTEXT 4
  1493. const GT_NOHIDDENTEXT 8
  1494. ' EM_GETTEXTEX info; this struct is passed in the wparam of the message
  1495. typedef struct _gettextex
  1496. {
  1497. DWORD cb; ' Count of bytes in the string
  1498. DWORD flags; ' Flags (see the GT_XXX defines
  1499. UINT codepage; ' Code page for translation (CP_ACP for sys default,
  1500. '1200 for Unicode, -1 for control default
  1501. LPCSTR lpDefaultChar; ' Replacement for unmappable chars
  1502. LPBOOL lpUsedDefChar; ' Pointer to flag set when def char used
  1503. } GETTEXTEX;
  1504. ' Flags for the GETTEXTLENGTHEX data structure
  1505. const GTL_DEFAULT 0 ' Do default (return # of chars
  1506. const GTL_USECRLF 1 ' Compute answer using CRLFs for paragraphs
  1507. const GTL_PRECISE 2 ' Compute a precise answer
  1508. const GTL_CLOSE 4 ' Fast computation of a "close" answer
  1509. const GTL_NUMCHARS 8 ' Return number of characters
  1510. const GTL_NUMBYTES 16 ' Return number of _bytes_
  1511. ' EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg
  1512. typedef struct _gettextlengthex
  1513. {
  1514. DWORD flags; ' Flags (see GTL_XXX defines
  1515. UINT codepage; ' Code page for translation (CP_ACP for default,
  1516. '1200 for Unicode
  1517. } GETTEXTLENGTHEX;
  1518. ' BiDi specific features
  1519. typedef struct _bidioptions
  1520. {
  1521. UINT cbSize;
  1522. WORD wMask;
  1523. WORD wEffects;
  1524. } BIDIOPTIONS;
  1525. ' BIDIOPTIONS masks
  1526. #if (_RICHEDIT_VER ===$0100
  1527. const BOM_DEFPARADIR =$0001 ' Default paragraph direction (implies alignment (obsolete
  1528. const BOM_PLAINTEXT =$0002 ' Use plain text layout (obsolete
  1529. #endif ' _RICHEDIT_VER ===$0100
  1530. const BOM_NEUTRALOVERRIDE =$0004 ' Override neutral layout (obsolete
  1531. const BOM_CONTEXTREADING =$0008 ' Context reading order
  1532. const BOM_CONTEXTALIGNMENT =$0010 ' Context alignment
  1533. ' BIDIOPTIONS effects
  1534. #if (_RICHEDIT_VER ===$0100
  1535. const BOE_RTLDIR =$0001 ' Default paragraph direction (implies alignment (obsolete
  1536. const BOE_PLAINTEXT =$0002 ' Use plain text layout (obsolete
  1537. #endif ' _RICHEDIT_VER ===$0100
  1538. const BOE_NEUTRALOVERRIDE =$0004 ' Override neutral layout (obsolete
  1539. const BOE_CONTEXTREADING =$0008 ' Context reading order
  1540. const BOE_CONTEXTALIGNMENT =$0010 ' Context alignment
  1541. ' Additional EM_FINDTEXT[EX] flags
  1542. const FR_MATCHDIAC=$20000000
  1543. const FR_MATCHKASHIDA =$40000000
  1544. const FR_MATCHALEFHAMZA =$80000000
  1545. ' UNICODE embedding character
  1546. #ifndef WCH_EMBEDDING
  1547. const WCH_EMBEDDING (WCHAR=$FFFC
  1548. #endif ' WCH_EMBEDDING
  1549. ' khyph - Kind of hyphenation
  1550. typedef enum tagKHYPH
  1551. {
  1552. khyphNil, ' No Hyphenation
  1553. khyphNormal, ' Normal Hyphenation
  1554. khyphAddBefore, ' Add letter before hyphen
  1555. khyphChangeBefore, ' Change letter before hyphen
  1556. khyphDeleteBefore, ' Delete letter before hyphen
  1557. khyphChangeAfter, ' Change letter after hyphen
  1558. khyphDelAndChange ' Delete letter before hyphen and change
  1559. 'letter preceding hyphen
  1560. } KHYPH;
  1561. typedef struct hyphresult
  1562. {
  1563. KHYPH khyph; ' Kind of hyphenation
  1564. longichHyph; ' Character which was hyphenated
  1565. WCHAR chHyph; ' Depending on hyphenation type, character added, changed, etc.
  1566. } HYPHRESULT;
  1567. void WINAPI HyphenateProc(WCHAR *pszWord, LANGID langid, long ichExceed, HYPHRESULT *phyphresult;
  1568. typedef struct tagHyphenateInfo
  1569. {
  1570. SHORT cbSize; ' Size of HYPHENATEINFO structure
  1571. SHORT dxHyphenateZone; ' If a space character is closer to the margin
  1572. 'than this value, don't hyphenate (in TWIPs
  1573. void (WINAPI* pfnHyphenate(WCHAR*, LANGID, long, HYPHRESULT*;
  1574. } HYPHENATEINFO;
  1575. #ifdef _WIN32
  1576. #include <poppack.h>
  1577. #elif !defined(RC_INVOKED
  1578. #pragma pack(
  1579. #endif
  1580. #ifdef __cplusplus
  1581. }
  1582. #endif' __cplusplus
  1583. #endif ' !_RICHEDIT_
  1584. EndRem