go-tg-screenshot-bot
1273 строки · 37.8 Кб
1// Copyright 2010 The win Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build windows
6
7package win8
9const (10// NOTE: MSFTEDIT.DLL only registers MSFTEDIT_CLASS. If an application wants11// to use the following RichEdit classes, it needs to load riched20.dll.12// Otherwise, CreateWindow with RICHEDIT_CLASS will fail.13// This also applies to any dialog that uses RICHEDIT_CLASS14// RichEdit 2.0 Window Class15MSFTEDIT_CLASS = "RICHEDIT50W"16RICHEDIT_CLASS = "RichEdit20W"17)
18
19// RichEdit messages
20const (21EM_CANPASTE = WM_USER + 5022EM_DISPLAYBAND = WM_USER + 5123EM_EXGETSEL = WM_USER + 5224EM_EXLIMITTEXT = WM_USER + 5325EM_EXLINEFROMCHAR = WM_USER + 5426EM_EXSETSEL = WM_USER + 5527EM_FINDTEXT = WM_USER + 5628EM_FORMATRANGE = WM_USER + 5729EM_GETCHARFORMAT = WM_USER + 5830EM_GETEVENTMASK = WM_USER + 5931EM_GETOLEINTERFACE = WM_USER + 6032EM_GETPARAFORMAT = WM_USER + 6133EM_GETSELTEXT = WM_USER + 6234EM_HIDESELECTION = WM_USER + 6335EM_PASTESPECIAL = WM_USER + 6436EM_REQUESTRESIZE = WM_USER + 6537EM_SELECTIONTYPE = WM_USER + 6638EM_SETBKGNDCOLOR = WM_USER + 6739EM_SETCHARFORMAT = WM_USER + 6840EM_SETEVENTMASK = WM_USER + 6941EM_SETOLECALLBACK = WM_USER + 7042EM_SETPARAFORMAT = WM_USER + 7143EM_SETTARGETDEVICE = WM_USER + 7244EM_STREAMIN = WM_USER + 7345EM_STREAMOUT = WM_USER + 7446EM_GETTEXTRANGE = WM_USER + 7547EM_FINDWORDBREAK = WM_USER + 7648EM_SETOPTIONS = WM_USER + 7749EM_GETOPTIONS = WM_USER + 7850EM_FINDTEXTEX = WM_USER + 7951EM_GETWORDBREAKPROCEX = WM_USER + 8052EM_SETWORDBREAKPROCEX = WM_USER + 8153)
54
55// RichEdit 2.0 messages
56const (57EM_SETUNDOLIMIT = WM_USER + 8258EM_REDO = WM_USER + 8459EM_CANREDO = WM_USER + 8560EM_GETUNDONAME = WM_USER + 8661EM_GETREDONAME = WM_USER + 8762EM_STOPGROUPTYPING = WM_USER + 8863
64EM_SETTEXTMODE = WM_USER + 8965EM_GETTEXTMODE = WM_USER + 9066)
67
68type TEXTMODE int3269
70const (71TM_PLAINTEXT TEXTMODE = 172TM_RICHTEXT = 2 // Default behavior73TM_SINGLELEVELUNDO = 474TM_MULTILEVELUNDO = 8 // Default behavior75TM_SINGLECODEPAGE = 1676TM_MULTICODEPAGE = 32 // Default behavior77)
78
79const (80EM_AUTOURLDETECT = WM_USER + 9181)
82
83// RichEdit 8.0 messages
84const (85AURL_ENABLEURL = 186AURL_ENABLEEMAILADDR = 287AURL_ENABLETELNO = 488AURL_ENABLEEAURLS = 889AURL_ENABLEDRIVELETTERS = 1690AURL_DISABLEMIXEDLGC = 32 // Disable mixed Latin Greek Cyrillic IDNs91)
92
93const (94EM_GETAUTOURLDETECT = WM_USER + 9295EM_SETPALETTE = WM_USER + 9396EM_GETTEXTEX = WM_USER + 9497EM_GETTEXTLENGTHEX = WM_USER + 9598EM_SHOWSCROLLBAR = WM_USER + 9699EM_SETTEXTEX = WM_USER + 97100)
101
102// East Asia specific messages
103const (104EM_SETPUNCTUATION = WM_USER + 100105EM_GETPUNCTUATION = WM_USER + 101106EM_SETWORDWRAPMODE = WM_USER + 102107EM_GETWORDWRAPMODE = WM_USER + 103108EM_SETIMECOLOR = WM_USER + 104109EM_GETIMECOLOR = WM_USER + 105110EM_SETIMEOPTIONS = WM_USER + 106111EM_GETIMEOPTIONS = WM_USER + 107112EM_CONVPOSITION = WM_USER + 108113)
114
115const (116EM_SETLANGOPTIONS = WM_USER + 120117EM_GETLANGOPTIONS = WM_USER + 121118EM_GETIMECOMPMODE = WM_USER + 122119
120EM_FINDTEXTW = WM_USER + 123121EM_FINDTEXTEXW = WM_USER + 124122)
123
124// RE3.0 FE messages
125const (126EM_RECONVERSION = WM_USER + 125127EM_SETIMEMODEBIAS = WM_USER + 126128EM_GETIMEMODEBIAS = WM_USER + 127129)
130
131// BiDi specific messages
132const (133EM_SETBIDIOPTIONS = WM_USER + 200134EM_GETBIDIOPTIONS = WM_USER + 201135
136EM_SETTYPOGRAPHYOPTIONS = WM_USER + 202137EM_GETTYPOGRAPHYOPTIONS = WM_USER + 203138)
139
140// Extended edit style specific messages
141const (142EM_SETEDITSTYLE = WM_USER + 204143EM_GETEDITSTYLE = WM_USER + 205144)
145
146// Extended edit style masks
147const (148SES_EMULATESYSEDIT = 1149SES_BEEPONMAXTEXT = 2150SES_EXTENDBACKCOLOR = 4151SES_MAPCPS = 8 // Obsolete (never used)152SES_HYPERLINKTOOLTIPS = 8153SES_EMULATE10 = 16 // Obsolete (never used)154SES_DEFAULTLATINLIGA = 16155SES_USECRLF = 32 // Obsolete (never used)156SES_NOFOCUSLINKNOTIFY = 32157SES_USEAIMM = 64158SES_NOIME = 128159
160SES_ALLOWBEEPS = 256161SES_UPPERCASE = 512162SES_LOWERCASE = 1024163SES_NOINPUTSEQUENCECHK = 2048164SES_BIDI = 4096165SES_SCROLLONKILLFOCUS = 8192166SES_XLTCRCRLFTOCR = 16384167SES_DRAFTMODE = 32768168
169SES_USECTF = 0x00010000170SES_HIDEGRIDLINES = 0x00020000171SES_USEATFONT = 0x00040000172SES_CUSTOMLOOK = 0x00080000173SES_LBSCROLLNOTIFY = 0x00100000174SES_CTFALLOWEMBED = 0x00200000175SES_CTFALLOWSMARTTAG = 0x00400000176SES_CTFALLOWPROOFING = 0x00800000177SES_LOGICALCARET = 0x01000000178SES_WORDDRAGDROP = 0x02000000179SES_SMARTDRAGDROP = 0x04000000180SES_MULTISELECT = 0x08000000181SES_CTFNOLOCK = 0x10000000182SES_NOEALINEHEIGHTADJUST = 0x20000000183SES_MAX = 0x20000000184)
185
186// Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS
187const (188IMF_AUTOKEYBOARD = 0x0001189IMF_AUTOFONT = 0x0002190IMF_IMECANCELCOMPLETE = 0x0004 // High completes comp string when aborting, low cancels191IMF_IMEALWAYSSENDNOTIFY = 0x0008192IMF_AUTOFONTSIZEADJUST = 0x0010193IMF_UIFONTS = 0x0020194IMF_NOIMPLICITLANG = 0x0040195IMF_DUALFONT = 0x0080196IMF_NOKBDLIDFIXUP = 0x0200197IMF_NORTFFONTSUBSTITUTE = 0x0400198IMF_SPELLCHECKING = 0x0800199IMF_TKBPREDICTION = 0x1000200IMF_IMEUIINTEGRATION = 0x2000201)
202
203// Values for EM_GETIMECOMPMODE
204const (205ICM_NOTOPEN = 0x0000206ICM_LEVEL3 = 0x0001207ICM_LEVEL2 = 0x0002208ICM_LEVEL2_5 = 0x0003209ICM_LEVEL2_SUI = 0x0004210ICM_CTF = 0x0005211)
212
213// Options for EM_SETTYPOGRAPHYOPTIONS
214const (215TO_ADVANCEDTYPOGRAPHY = 0x0001216TO_SIMPLELINEBREAK = 0x0002217TO_DISABLECUSTOMTEXTOUT = 0x0004218TO_ADVANCEDLAYOUT = 0x0008219)
220
221// Pegasus outline mode messages (RE 3.0)
222const (223// Outline mode message224EM_OUTLINE = WM_USER + 220225
226// Message for getting and restoring scroll pos227EM_GETSCROLLPOS = WM_USER + 221228EM_SETSCROLLPOS = WM_USER + 222229
230// Change fontsize in current selection by wParam231EM_SETFONTSIZE = WM_USER + 223232EM_GETZOOM = WM_USER + 224233EM_SETZOOM = WM_USER + 225234EM_GETVIEWKIND = WM_USER + 226235EM_SETVIEWKIND = WM_USER + 227236)
237
238// RichEdit 4.0 messages
239const (240EM_GETPAGE = WM_USER + 228241EM_SETPAGE = WM_USER + 229242EM_GETHYPHENATEINFO = WM_USER + 230243EM_SETHYPHENATEINFO = WM_USER + 231244
245EM_GETPAGEROTATE = WM_USER + 235246EM_SETPAGEROTATE = WM_USER + 236247EM_GETCTFMODEBIAS = WM_USER + 237248EM_SETCTFMODEBIAS = WM_USER + 238249EM_GETCTFOPENSTATUS = WM_USER + 240250EM_SETCTFOPENSTATUS = WM_USER + 241251EM_GETIMECOMPTEXT = WM_USER + 242252EM_ISIME = WM_USER + 243253EM_GETIMEPROPERTY = WM_USER + 244254)
255
256// These messages control what rich edit does when it comes accross
257// OLE objects during RTF stream in. Normally rich edit queries the client
258// application only after OleLoad has been called. With these messages it is possible to
259// set the rich edit control to a mode where it will query the client application before
260// OleLoad is called
261const (262EM_GETQUERYRTFOBJ = WM_USER + 269263EM_SETQUERYRTFOBJ = WM_USER + 270264)
265
266// EM_SETPAGEROTATE wparam values
267const (268EPR_0 = 0 // Text flows left to right and top to bottom269EPR_270 = 1 // Text flows top to bottom and right to left270EPR_180 = 2 // Text flows right to left and bottom to top271EPR_90 = 3 // Text flows bottom to top and left to right272EPR_SE = 5 // Text flows top to bottom and left to right (Mongolian text layout)273)
274
275// EM_SETCTFMODEBIAS wparam values
276const (277CTFMODEBIAS_DEFAULT = 0x0000278CTFMODEBIAS_FILENAME = 0x0001279CTFMODEBIAS_NAME = 0x0002280CTFMODEBIAS_READING = 0x0003281CTFMODEBIAS_DATETIME = 0x0004282CTFMODEBIAS_CONVERSATION = 0x0005283CTFMODEBIAS_NUMERIC = 0x0006284CTFMODEBIAS_HIRAGANA = 0x0007285CTFMODEBIAS_KATAKANA = 0x0008286CTFMODEBIAS_HANGUL = 0x0009287CTFMODEBIAS_HALFWIDTHKATAKANA = 0x000A288CTFMODEBIAS_FULLWIDTHALPHANUMERIC = 0x000B289CTFMODEBIAS_HALFWIDTHALPHANUMERIC = 0x000C290)
291
292// EM_SETIMEMODEBIAS lparam values
293const (294IMF_SMODE_PLAURALCLAUSE = 0x0001295IMF_SMODE_NONE = 0x0002296)
297
298// EM_GETIMECOMPTEXT wparam structure
299type IMECOMPTEXT struct {300// count of bytes in the output buffer.301Cb int32302
303// value specifying the composition string type.304// Currently only support ICT_RESULTREADSTR305Flags uint32306}
307
308const ICT_RESULTREADSTR = 1309
310// Outline mode wparam values
311const (312// Enter normal mode, lparam ignored313EMO_EXIT = 0314
315// Enter outline mode, lparam ignored316EMO_ENTER = 1317
318// LOWORD(lparam) == 0 ==>319// promote to body-text320// LOWORD(lparam) != 0 ==>321// promote/demote current selection322// by indicated number of levels323EMO_PROMOTE = 2324
325// HIWORD(lparam) = EMO_EXPANDSELECTION326// -> expands selection to level327// indicated in LOWORD(lparam)328// LOWORD(lparam) = -1/+1 corresponds329// to collapse/expand button presses330// in winword (other values are331// equivalent to having pressed these332// buttons more than once)333// HIWORD(lparam) = EMO_EXPANDDOCUMENT334// -> expands whole document to335// indicated level336EMO_EXPAND = 3337
338// LOWORD(lparam) != 0 -> move current339// selection up/down by indicated amount340EMO_MOVESELECTION = 4341
342// Returns VM_NORMAL or VM_OUTLINE343EMO_GETVIEWMODE = 5344)
345
346// EMO_EXPAND options
347const (348EMO_EXPANDSELECTION = 0349EMO_EXPANDDOCUMENT = 1350)
351
352const (353// Agrees with RTF \viewkindN354VM_NORMAL = 4355
356VM_OUTLINE = 2357
358// Screen page view (not print layout)359VM_PAGE = 9360)
361
362// New messages as of Win8
363const (364EM_INSERTTABLE = WM_USER + 232365)
366
367// Data type defining table rows for EM_INSERTTABLE
368// Note: The Richedit.h is completely #pragma pack(4)-ed
369type TABLEROWPARMS struct { // EM_INSERTTABLE wparam is a (TABLEROWPARMS *)370CbRow uint32 // Count of bytes in this structure371CbCell uint32 // Count of bytes in TABLECELLPARMS372CCell uint32 // Count of cells373CRow uint32 // Count of rows374DxCellMargin int32 // Cell left/right margin (\trgaph)375DxIndent int32 // Row left (right if fRTL indent (similar to \trleft)376DyHeight int32 // Row height (\trrh)377
378// nAlignment:3 Row alignment (like PARAFORMAT::bAlignment, \trql, trqr, \trqc)379// fRTL:1 Display cells in RTL order (\rtlrow)380// fKeep:1 Keep row together (\trkeep}381// fKeepFollow:1 Keep row on same page as following row (\trkeepfollow)382// fWrap:1 Wrap text to right/left (depending on bAlignment) (see \tdfrmtxtLeftN, \tdfrmtxtRightN)383// fIdentCells:1 lparam points at single struct valid for all cells384Flags uint32385
386CpStartRow int32 // cp where to insert table (-1 for selection cp) (can be used for either TRD by EM_GETTABLEPARMS)387BTableLevel uint32 // Table nesting level (EM_GETTABLEPARMS only)388ICell uint32 // Index of cell to insert/delete (EM_SETTABLEPARMS only)389}
390
391// Data type defining table cells for EM_INSERTTABLE
392// Note: The Richedit.h is completely #pragma pack(4)-ed
393type TABLECELLPARMS struct { // EM_INSERTTABLE lparam is a (TABLECELLPARMS *)394DxWidth int32 // Cell width (\cellx)395
396// nVertAlign:2 Vertical alignment (0/1/2 = top/center/bottom \clvertalt (def), \clvertalc, \clvertalb)397// fMergeTop:1 Top cell for vertical merge (\clvmgf)398// fMergePrev:1 Merge with cell above (\clvmrg)399// fVertical:1 Display text top to bottom, right to left (\cltxtbrlv)400// fMergeStart:1 Start set of horizontally merged cells (\clmgf)401// fMergeCont:1 Merge with previous cell (\clmrg)402Flags uint32403
404WShading uint32 // Shading in .01% (\clshdng) e.g., 10000 flips fore/back405
406DxBrdrLeft int32 // Left border width (\clbrdrl\brdrwN) (in twips)407DyBrdrTop int32 // Top border width (\clbrdrt\brdrwN)408DxBrdrRight int32 // Right border width (\clbrdrr\brdrwN)409DyBrdrBottom int32 // Bottom border width (\clbrdrb\brdrwN)410
411CrBrdrLeft COLORREF // Left border color (\clbrdrl\brdrcf)412CrBrdrTop COLORREF // Top border color (\clbrdrt\brdrcf)413CrBrdrRight COLORREF // Right border color (\clbrdrr\brdrcf)414CrBrdrBottom COLORREF // Bottom border color (\clbrdrb\brdrcf)415CrBackPat COLORREF // Background color (\clcbpat)416CrForePat COLORREF // Foreground color (\clcfpat)417}
418
419const (420EM_GETAUTOCORRECTPROC = WM_USER + 233421EM_SETAUTOCORRECTPROC = WM_USER + 234422EM_CALLAUTOCORRECTPROC = WM_USER + 255423)
424
425// AutoCorrect callback
426type AutoCorrectProc func(langid LANGID, pszBefore *uint16, pszAfter *uint16, cchAfter int32, pcchReplaced *int32) int427
428const (429ATP_NOCHANGE = 0430ATP_CHANGE = 1431ATP_NODELIMITER = 2432ATP_REPLACEALLTEXT = 4433)
434
435const (436EM_GETTABLEPARMS = WM_USER + 265437
438EM_SETEDITSTYLEEX = WM_USER + 275439EM_GETEDITSTYLEEX = WM_USER + 276440)
441
442// wparam values for EM_SETEDITSTYLEEX/EM_GETEDITSTYLEEX
443// All unused bits are reserved.
444const (445SES_EX_NOTABLE = 0x00000004446SES_EX_NOMATH = 0x00000040447SES_EX_HANDLEFRIENDLYURL = 0x00000100448SES_EX_NOTHEMING = 0x00080000449SES_EX_NOACETATESELECTION = 0x00100000450SES_EX_USESINGLELINE = 0x00200000451SES_EX_MULTITOUCH = 0x08000000 // Only works under Win8+452SES_EX_HIDETEMPFORMAT = 0x10000000453SES_EX_USEMOUSEWPARAM = 0x20000000 // Use wParam when handling WM_MOUSEMOVE message and do not call GetAsyncKeyState454)
455
456const (457EM_GETSTORYTYPE = WM_USER + 290458EM_SETSTORYTYPE = WM_USER + 291459
460EM_GETELLIPSISMODE = WM_USER + 305461EM_SETELLIPSISMODE = WM_USER + 306462)
463
464// uint32: *lparam for EM_GETELLIPSISMODE, lparam for EM_SETELLIPSISMODE
465const (466ELLIPSIS_MASK = 0x00000003 // all meaningful bits467ELLIPSIS_NONE = 0x00000000 // ellipsis disabled468ELLIPSIS_END = 0x00000001 // ellipsis at the end (forced break)469ELLIPSIS_WORD = 0x00000003 // ellipsis at the end (word break)470)
471
472const (473EM_SETTABLEPARMS = WM_USER + 307474
475EM_GETTOUCHOPTIONS = WM_USER + 310476EM_SETTOUCHOPTIONS = WM_USER + 311477EM_INSERTIMAGE = WM_USER + 314478EM_SETUIANAME = WM_USER + 320479EM_GETELLIPSISSTATE = WM_USER + 322480)
481
482// Values for EM_SETTOUCHOPTIONS/EM_GETTOUCHOPTIONS
483const (484RTO_SHOWHANDLES = 1485RTO_DISABLEHANDLES = 2486RTO_READINGMODE = 3487)
488
489// lparam for EM_INSERTIMAGE
490type RICHEDIT_IMAGE_PARAMETERS struct {491XWidth int32 // Units are HIMETRIC492YHeight int32 // Units are HIMETRIC493Ascent int32 // Units are HIMETRIC494Type int32 // Valid values are TA_TOP, TA_BOTTOM and TA_BASELINE495PwszAlternateText *uint16496PIStream uintptr497}
498
499// New notifications
500const (501EN_MSGFILTER = 0x0700502EN_REQUESTRESIZE = 0x0701503EN_SELCHANGE = 0x0702504EN_DROPFILES = 0x0703505EN_PROTECTED = 0x0704506EN_CORRECTTEXT = 0x0705 // PenWin specific507EN_STOPNOUNDO = 0x0706508EN_IMECHANGE = 0x0707 // East Asia specific509EN_SAVECLIPBOARD = 0x0708510EN_OLEOPFAILED = 0x0709511EN_OBJECTPOSITIONS = 0x070a512EN_LINK = 0x070b513EN_DRAGDROPDONE = 0x070c514EN_PARAGRAPHEXPANDED = 0x070d515EN_PAGECHANGE = 0x070e516EN_LOWFIRTF = 0x070f517EN_ALIGNLTR = 0x0710 // BiDi specific notification518EN_ALIGNRTL = 0x0711 // BiDi specific notification519EN_CLIPFORMAT = 0x0712520EN_STARTCOMPOSITION = 0x0713521EN_ENDCOMPOSITION = 0x0714522)
523
524// Notification structure for EN_ENDCOMPOSITION
525type ENDCOMPOSITIONNOTIFY struct {526Nmhdr NMHDR
527DwCode uint32528}
529
530// Constants for ENDCOMPOSITIONNOTIFY dwCode
531const (532ECN_ENDCOMPOSITION = 0x0001533ECN_NEWTEXT = 0x0002534)
535
536// Event notification masks
537const (538ENM_NONE = 0x00000000539ENM_CHANGE = 0x00000001540ENM_UPDATE = 0x00000002541ENM_SCROLL = 0x00000004542ENM_SCROLLEVENTS = 0x00000008543ENM_DRAGDROPDONE = 0x00000010544ENM_PARAGRAPHEXPANDED = 0x00000020545ENM_PAGECHANGE = 0x00000040546ENM_CLIPFORMAT = 0x00000080547ENM_KEYEVENTS = 0x00010000548ENM_MOUSEEVENTS = 0x00020000549ENM_REQUESTRESIZE = 0x00040000550ENM_SELCHANGE = 0x00080000551ENM_DROPFILES = 0x00100000552ENM_PROTECTED = 0x00200000553ENM_CORRECTTEXT = 0x00400000 // PenWin specific554ENM_IMECHANGE = 0x00800000 // Used by RE1.0 compatibility555ENM_LANGCHANGE = 0x01000000556ENM_OBJECTPOSITIONS = 0x02000000557ENM_LINK = 0x04000000558ENM_LOWFIRTF = 0x08000000559ENM_STARTCOMPOSITION = 0x10000000560ENM_ENDCOMPOSITION = 0x20000000561ENM_GROUPTYPINGCHANGE = 0x40000000562ENM_HIDELINKTOOLTIP = 0x80000000563)
564
565// New edit control styles
566const (567ES_SAVESEL = 0x00008000568ES_SUNKEN = 0x00004000569ES_DISABLENOSCROLL = 0x00002000570ES_SELECTIONBAR = 0x01000000 // Same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value571ES_NOOLEDRAGDROP = 0x00000008 // Same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop572)
573
574// Obsolete Edit Style
575const (576ES_EX_NOCALLOLEINIT = 0x00000000 // Not supported in RE 2.0/3.0577)
578
579// These flags are used in FE Windows
580const (581ES_VERTICAL = 0x00400000 // Not supported in RE 2.0/3.0582ES_NOIME = 0x00080000583ES_SELFIME = 0x00040000584)
585
586// Edit control options
587const (588ECO_AUTOWORDSELECTION = 0x00000001589ECO_AUTOVSCROLL = 0x00000040590ECO_AUTOHSCROLL = 0x00000080591ECO_NOHIDESEL = 0x00000100592ECO_READONLY = 0x00000800593ECO_WANTRETURN = 0x00001000594ECO_SAVESEL = 0x00008000595ECO_SELECTIONBAR = 0x01000000596ECO_VERTICAL = 0x00400000 // FE specific597)
598
599// ECO operations
600const (601ECOOP_SET = 0x0001602ECOOP_OR = 0x0002603ECOOP_AND = 0x0003604ECOOP_XOR = 0x0004605)
606
607// New word break function actions
608const (609WB_CLASSIFY = 3610WB_MOVEWORDLEFT = 4611WB_MOVEWORDRIGHT = 5612WB_LEFTBREAK = 6613WB_RIGHTBREAK = 7614)
615
616// East Asia specific flags
617const (618WB_MOVEWORDPREV = 4619WB_MOVEWORDNEXT = 5620WB_PREVBREAK = 6621WB_NEXTBREAK = 7622
623PC_FOLLOWING = 1624PC_LEADING = 2625PC_OVERFLOW = 3626PC_DELIMITER = 4627WBF_WORDWRAP = 0x010628WBF_WORDBREAK = 0x020629WBF_OVERFLOW = 0x040630WBF_LEVEL1 = 0x080631WBF_LEVEL2 = 0x100632WBF_CUSTOM = 0x200633)
634
635// East Asia specific flags
636const (637IMF_FORCENONE = 0x0001638IMF_FORCEENABLE = 0x0002639IMF_FORCEDISABLE = 0x0004640IMF_CLOSESTATUSWINDOW = 0x0008641IMF_VERTICAL = 0x0020642IMF_FORCEACTIVE = 0x0040643IMF_FORCEINACTIVE = 0x0080644IMF_FORCEREMEMBER = 0x0100645IMF_MULTIPLEEDIT = 0x0400646)
647
648// Word break flags (used with WB_CLASSIFY)
649const (650WBF_CLASS byte = 0x0F651WBF_ISWHITE byte = 0x10652WBF_BREAKLINE byte = 0x20653WBF_BREAKAFTER byte = 0x40654)
655
656type CHARFORMAT struct {657CbSize uint32658DwMask uint32659DwEffects uint32660YHeight int32661YOffset int32662CrTextColor COLORREF
663BCharSet byte664BPitchAndFamily byte665SzFaceName [LF_FACESIZE]uint16666}
667
668type CHARFORMAT2 struct {669CHARFORMAT
670WWeight uint16 // Font weight (LOGFONT value)671SSpacing int16 // Amount to space between letters672CrBackColor COLORREF // Background color673Lcid LCID // Locale ID674DwCookie uint32 // Client cookie opaque to RichEdit675SStyle int16 // Style handle676WKerning uint16 // Twip size above which to kern char pair677BUnderlineType byte // Underline type678BAnimation byte // Animated text like marching ants679BRevAuthor byte // Revision author index680BUnderlineColor byte // Underline color681}
682
683// CHARFORMAT masks
684const (685CFM_BOLD = 0x00000001686CFM_ITALIC = 0x00000002687CFM_UNDERLINE = 0x00000004688CFM_STRIKEOUT = 0x00000008689CFM_PROTECTED = 0x00000010690CFM_LINK = 0x00000020 // Exchange hyperlink extension691CFM_SIZE = 0x80000000692CFM_COLOR = 0x40000000693CFM_FACE = 0x20000000694CFM_OFFSET = 0x10000000695CFM_CHARSET = 0x08000000696)
697
698// CHARFORMAT effects
699const (700CFE_BOLD = 0x00000001701CFE_ITALIC = 0x00000002702CFE_UNDERLINE = 0x00000004703CFE_STRIKEOUT = 0x00000008704CFE_PROTECTED = 0x00000010705CFE_LINK = 0x00000020706CFE_AUTOCOLOR = 0x40000000 // NOTE: this corresponds to CFM_COLOR, which controls it707
708// Masks and effects defined for CHARFORMAT2 -- an (*) indicates that the data is stored by RichEdit 2.0/3.0, but not displayed709CFM_SMALLCAPS = 0x00000040 // (*)710CFM_ALLCAPS = 0x00000080 // Displayed by 3.0711CFM_HIDDEN = 0x00000100 // Hidden by 3.0712CFM_OUTLINE = 0x00000200 // (*)713CFM_SHADOW = 0x00000400 // (*)714CFM_EMBOSS = 0x00000800 // (*)715CFM_IMPRINT = 0x00001000 // (*)716CFM_DISABLED = 0x00002000717CFM_REVISED = 0x00004000718
719CFM_REVAUTHOR = 0x00008000720CFE_SUBSCRIPT = 0x00010000 // Superscript and subscript are721CFE_SUPERSCRIPT = 0x00020000 // mutually exclusive722CFM_ANIMATION = 0x00040000 // (*)723CFM_STYLE = 0x00080000 // (*)724CFM_KERNING = 0x00100000725CFM_SPACING = 0x00200000 // Displayed by 3.0726CFM_WEIGHT = 0x00400000727CFM_UNDERLINETYPE = 0x00800000 // Many displayed by 3.0728CFM_COOKIE = 0x01000000 // RE 6.0729CFM_LCID = 0x02000000730CFM_BACKCOLOR = 0x04000000 // Higher mask bits defined above731
732CFM_SUBSCRIPT = (CFE_SUBSCRIPT | CFE_SUPERSCRIPT)733CFM_SUPERSCRIPT = CFM_SUBSCRIPT734
735// CHARFORMAT "ALL" masks736CFM_EFFECTS = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK737CFM_ALL = CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET738CFM_EFFECTS2 = CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS | CFM_HIDDEN | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS | CFM_IMPRINT | CFM_REVISED | CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR739CFM_ALL2 = CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION | CFM_COOKIE740
741CFE_SMALLCAPS = CFM_SMALLCAPS742CFE_ALLCAPS = CFM_ALLCAPS743CFE_HIDDEN = CFM_HIDDEN744CFE_OUTLINE = CFM_OUTLINE745CFE_SHADOW = CFM_SHADOW746CFE_EMBOSS = CFM_EMBOSS747CFE_IMPRINT = CFM_IMPRINT748CFE_DISABLED = CFM_DISABLED749CFE_REVISED = CFM_REVISED750
751// CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and752// CFM_BACKCOLOR, respectively, which control them753CFE_AUTOBACKCOLOR = CFM_BACKCOLOR754
755CFM_FONTBOUND = 0x00100000756CFM_LINKPROTECTED = 0x00800000 // Word hyperlink field757CFM_EXTENDED = 0x02000000758CFM_MATHNOBUILDUP = 0x08000000759CFM_MATH = 0x10000000760CFM_MATHORDINARY = 0x20000000761
762CFM_ALLEFFECTS = (CFM_EFFECTS2 | CFM_FONTBOUND | CFM_EXTENDED | CFM_MATHNOBUILDUP | CFM_MATH | CFM_MATHORDINARY)763
764CFE_FONTBOUND = 0x00100000 // Font chosen by binder, not user765CFE_LINKPROTECTED = 0x00800000766CFE_EXTENDED = 0x02000000767CFE_MATHNOBUILDUP = 0x08000000768CFE_MATH = 0x10000000769CFE_MATHORDINARY = 0x20000000770
771// Underline types. RE 1.0 displays only CFU_UNDERLINE772CFU_CF1UNDERLINE = 0xFF // Map charformat's bit underline to CF2773CFU_INVERT = 0xFE // For IME composition fake a selection774CFU_UNDERLINETHICKLONGDASH = 18 // (*) display as dash775CFU_UNDERLINETHICKDOTTED = 17 // (*) display as dot776CFU_UNDERLINETHICKDASHDOTDOT = 16 // (*) display as dash dot dot777CFU_UNDERLINETHICKDASHDOT = 15 // (*) display as dash dot778CFU_UNDERLINETHICKDASH = 14 // (*) display as dash779CFU_UNDERLINELONGDASH = 13 // (*) display as dash780CFU_UNDERLINEHEAVYWAVE = 12 // (*) display as wave781CFU_UNDERLINEDOUBLEWAVE = 11 // (*) display as wave782CFU_UNDERLINEHAIRLINE = 10 // (*) display as single783CFU_UNDERLINETHICK = 9784CFU_UNDERLINEWAVE = 8785CFU_UNDERLINEDASHDOTDOT = 7786CFU_UNDERLINEDASHDOT = 6787CFU_UNDERLINEDASH = 5788CFU_UNDERLINEDOTTED = 4789CFU_UNDERLINEDOUBLE = 3 // (*) display as single790CFU_UNDERLINEWORD = 2 // (*) display as single791CFU_UNDERLINE = 1792CFU_UNDERLINENONE = 0793)
794
795const YHeightCharPtsMost = 1638796
797const (798// EM_SETCHARFORMAT wParam masks799SCF_SELECTION = 0x0001800SCF_WORD = 0x0002801SCF_DEFAULT = 0x0000 // Set default charformat or paraformat802SCF_ALL = 0x0004 // Not valid with SCF_SELECTION or SCF_WORD803SCF_USEUIRULES = 0x0008 // Modifier for SCF_SELECTION; says that came from a toolbar, etc., and UI formatting rules should be instead of literal formatting804SCF_ASSOCIATEFONT = 0x0010 // Associate fontname with bCharSet (one possible for each of Western, ME, FE, Thai)805SCF_NOKBUPDATE = 0x0020 // Do not update KB layout for this change even if autokeyboard is on806SCF_ASSOCIATEFONT2 = 0x0040 // Associate plane-2 (surrogate) font807SCF_SMARTFONT = 0x0080 // Apply font only if it can handle script (5.0)808SCF_CHARREPFROMLCID = 0x0100 // Get character repertoire from lcid (5.0)809
810SPF_DONTSETDEFAULT = 0x0002 // Suppress setting default on empty control811SPF_SETDEFAULT = 0x0004 // Set the default paraformat812)
813
814type CHARRANGE struct {815CpMin int32816CpMax int32817}
818
819type TEXTRANGE struct {820Chrg CHARRANGE
821LpstrText *uint16 // Allocated by caller, zero terminated by RichEdit822}
823
824type EDITSTREAM struct {825DwCookie uintptr // User value passed to callback as first parameter826DwError uint32 // Last error827PfnCallback uintptr828}
829
830const (831// Stream formats. Flags are all in low word, since high word gives possible codepage choice.832SF_TEXT = 0x0001833SF_RTF = 0x0002834SF_RTFNOOBJS = 0x0003 // Write only835SF_TEXTIZED = 0x0004 // Write only836
837SF_UNICODE = 0x0010 // Unicode file (UCS2 little endian)838SF_USECODEPAGE = 0x0020 // CodePage given by high word839SF_NCRFORNONASCII = 0x40 // Output \uN for nonASCII840SFF_WRITEXTRAPAR = 0x80 // Output \par at end841
842// Flag telling stream operations to operate on selection only843// EM_STREAMIN replaces current selection844// EM_STREAMOUT streams out current selection845SFF_SELECTION = 0x8000846
847// Flag telling stream operations to ignore some FE control words having to do with FE word breaking and horiz vs vertical text.848// Not used in RichEdit 2.0 and later849SFF_PLAINRTF = 0x4000850
851// Flag telling file stream output (SFF_SELECTION flag not set) to persist // \viewscaleN control word.852SFF_PERSISTVIEWSCALE = 0x2000853
854// Flag telling file stream input with SFF_SELECTION flag not set not to // close the document855SFF_KEEPDOCINFO = 0x1000856
857// Flag telling stream operations to output in Pocket Word format858SFF_PWD = 0x0800859
860// 3-bit field specifying the value of N - 1 to use for \rtfN or \pwdN861SF_RTFVAL = 0x0700862)
863
864type FINDTEXT struct {865Chrg CHARRANGE
866LpstrText *uint16867}
868
869type FINDTEXTEX struct {870chrg CHARRANGE
871lpstrText *uint16872chrgText CHARRANGE
873}
874
875type FORMATRANGE struct {876hdc HDC
877hdcTarget HDC
878rc RECT
879rcPage RECT
880chrg CHARRANGE
881}
882
883// All paragraph measurements are in twips
884const (885MAX_TAB_STOPS = 32886LDefaultTab = 720887MAX_TABLE_CELLS = 63888)
889
890type PARAFORMAT struct {891CbSize uint32892DwMask uint32893WNumbering uint16894WEffects uint16895DxStartIndent int32896DxRightIndent int32897DxOffset int32898WAlignment uint16899CTabCount int16900RgxTabs [MAX_TAB_STOPS]int32901}
902
903type PARAFORMAT2 struct {904PARAFORMAT
905DySpaceBefore int32 // Vertical spacing before para906DySpaceAfter int32 // Vertical spacing after para907DyLineSpacing int32 // Line spacing depending on Rule908SStyle int16 // Style handle909BLineSpacingRule byte // Rule for line spacing (see tom.doc)910BOutlineLevel byte // Outline level911WShadingWeight uint16 // Shading in hundredths of a per cent912WShadingStyle uint16 // Nibble 0: style, 1: cfpat, 2: cbpat913WNumberingStart uint16 // Starting value for numbering914WNumberingStyle uint16 // Alignment, roman/arabic, (), ), ., etc.915WNumberingTab uint16 // Space bet FirstIndent & 1st-line text916WBorderSpace uint16 // Border-text spaces (nbl/bdr in pts)917WBorderWidth uint16 // Pen widths (nbl/bdr in half pts)918WBorders uint16 // Border styles (nibble/border)919}
920
921const (922// PARAFORMAT mask values923PFM_STARTINDENT = 0x00000001924PFM_RIGHTINDENT = 0x00000002925PFM_OFFSET = 0x00000004926PFM_ALIGNMENT = 0x00000008927PFM_TABSTOPS = 0x00000010928PFM_NUMBERING = 0x00000020929PFM_OFFSETINDENT = 0x80000000930
931// PARAFORMAT 2.0 masks and effects932PFM_SPACEBEFORE = 0x00000040933PFM_SPACEAFTER = 0x00000080934PFM_LINESPACING = 0x00000100935PFM_STYLE = 0x00000400936PFM_BORDER = 0x00000800 // (*)937PFM_SHADING = 0x00001000 // (*)938PFM_NUMBERINGSTYLE = 0x00002000 // RE 3.0939PFM_NUMBERINGTAB = 0x00004000 // RE 3.0940PFM_NUMBERINGSTART = 0x00008000 // RE 3.0941
942PFM_RTLPARA = 0x00010000943PFM_KEEP = 0x00020000 // (*)944PFM_KEEPNEXT = 0x00040000 // (*)945PFM_PAGEBREAKBEFORE = 0x00080000 // (*)946PFM_NOLINENUMBER = 0x00100000 // (*)947PFM_NOWIDOWCONTROL = 0x00200000 // (*)948PFM_DONOTHYPHEN = 0x00400000 // (*)949PFM_SIDEBYSIDE = 0x00800000 // (*)950
951// The following two paragraph-format properties are read only952PFM_COLLAPSED = 0x01000000 // RE 3.0953PFM_OUTLINELEVEL = 0x02000000 // RE 3.0954PFM_BOX = 0x04000000 // RE 3.0955PFM_RESERVED2 = 0x08000000 // RE 4.0956PFM_TABLEROWDELIMITER = 0x10000000 // RE 4.0957PFM_TEXTWRAPPINGBREAK = 0x20000000 // RE 3.0958PFM_TABLE = 0x40000000 // RE 3.0959
960// PARAFORMAT "ALL" masks961PFM_ALL = PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | PFM_ALIGNMENT | PFM_TABSTOPS | PFM_NUMBERING | PFM_OFFSETINDENT | PFM_RTLPARA962
963// Note: PARAFORMAT has no effects (BiDi RichEdit 1.0 does have PFE_RTLPARA)964PFM_EFFECTS = PFM_RTLPARA | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE | PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER | PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE | PFM_TABLE | PFM_TABLEROWDELIMITER965
966PFM_ALL2 = PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER | PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER | PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE967
968PFE_RTLPARA = PFM_RTLPARA >> 16969PFE_KEEP = PFM_KEEP >> 16 // (*)970PFE_KEEPNEXT = PFM_KEEPNEXT >> 16 // (*)971PFE_PAGEBREAKBEFORE = PFM_PAGEBREAKBEFORE >> 16 // (*)972PFE_NOLINENUMBER = PFM_NOLINENUMBER >> 16 // (*)973PFE_NOWIDOWCONTROL = PFM_NOWIDOWCONTROL >> 16 // (*)974PFE_DONOTHYPHEN = PFM_DONOTHYPHEN >> 16 // (*)975PFE_SIDEBYSIDE = PFM_SIDEBYSIDE >> 16 // (*)976PFE_TEXTWRAPPINGBREAK = PFM_TEXTWRAPPINGBREAK >> 16 // (*)977
978// The following four effects are read only979PFE_COLLAPSED = PFM_COLLAPSED >> 16 // (+)980PFE_BOX = PFM_BOX >> 16 // (+)981PFE_TABLE = PFM_TABLE >> 16 // Inside table row. RE 3.0982PFE_TABLEROWDELIMITER = PFM_TABLEROWDELIMITER >> 16 // Table row start. RE 4.0983
984// PARAFORMAT numbering options985PFN_BULLET = 1 // tomListBullet986
987// PARAFORMAT2 wNumbering options988PFN_ARABIC = 2 // tomListNumberAsArabic: 0, 1, 2, ...989PFN_LCLETTER = 3 // tomListNumberAsLCLetter: a, b, c, ...990PFN_UCLETTER = 4 // tomListNumberAsUCLetter: A, B, C, ...991PFN_LCROMAN = 5 // tomListNumberAsLCRoman: i, ii, iii, ...992PFN_UCROMAN = 6 // tomListNumberAsUCRoman: I, II, III, ...993
994// PARAFORMAT2 wNumberingStyle options995PFNS_PAREN = 0x000 // default, e.g., 1)996PFNS_PARENS = 0x100 // tomListParentheses/256, e.g., (1)997PFNS_PERIOD = 0x200 // tomListPeriod/256, e.g., 1.998PFNS_PLAIN = 0x300 // tomListPlain/256, e.g., 1999PFNS_NONUMBER = 0x400 // Used for continuation w/o number1000
1001PFNS_NEWNUMBER = 0x8000 // Start new number with wNumberingStart1002// (can be combined with other PFNS_xxx)1003// PARAFORMAT alignment options1004PFA_LEFT = 11005PFA_RIGHT = 21006PFA_CENTER = 31007
1008// PARAFORMAT2 alignment options1009PFA_JUSTIFY = 4 // New paragraph-alignment option 2.0 (*)1010PFA_FULL_INTERWORD = 4 // These are supported in 3.0 with advanced1011)
1012
1013type MSGFILTER struct {1014Nmhdr NMHDR
1015Msg uint321016WParam uintptr1017LParam uintptr1018}
1019
1020type REQRESIZE struct {1021Nmhdr NMHDR
1022Rc RECT
1023}
1024
1025type SELCHANGE struct {1026Nmhdr NMHDR
1027Chrg CHARRANGE
1028Seltyp uint161029}
1030
1031type GROUPTYPINGCHANGE struct {1032Nmhdr NMHDR
1033FGroupTyping BOOL
1034}
1035
1036type CLIPBOARDFORMAT struct {1037Nmhdr NMHDR
1038Cf CLIPFORMAT
1039}
1040
1041const (1042SEL_EMPTY = 0x00001043SEL_TEXT = 0x00011044SEL_OBJECT = 0x00021045SEL_MULTICHAR = 0x00041046SEL_MULTIOBJECT = 0x00081047)
1048
1049const (1050// Used with IRichEditOleCallback::GetContextMenu, this flag will be passed as a "selection type". It indicates that a context menu for a right-mouse drag drop should be generated. The IOleObject parameter will really be the IDataObject for the drop1051GCM_RIGHTMOUSEDROP = 0x80001052)
1053
1054type GETCONTEXTMENUEX struct {1055Chrg CHARRANGE
1056DwFlags uint321057Pt POINT
1058PvReserved uintptr1059}
1060
1061const (1062// bits for GETCONTEXTMENUEX::dwFlags1063GCMF_GRIPPER = 0x000000011064GCMF_SPELLING = 0x00000002 // pSpellingSuggestions is valid and points to the list of spelling suggestions1065GCMF_TOUCHMENU = 0x000040001066GCMF_MOUSEMENU = 0x000020001067)
1068
1069type ENDROPFILES struct {1070Nmhdr NMHDR
1071HDrop HANDLE
1072Cp int321073FProtected BOOL
1074}
1075
1076type ENPROTECTED struct {1077Nmhdr NMHDR
1078Msg uint321079WParam uintptr1080LParam uintptr1081Chrg CHARRANGE
1082}
1083
1084type ENSAVECLIPBOARD struct {1085Nmhdr NMHDR
1086CObjectCount int321087Cch int321088}
1089
1090type ENOLEOPFAILED struct {1091Nmhdr NMHDR
1092Iob int321093LOper int321094Hr HRESULT
1095}
1096
1097const OLEOP_DOVERB = 11098
1099type OBJECTPOSITIONS struct {1100Nmhdr NMHDR
1101CObjectCount int321102PcpPositions *int321103}
1104
1105type ENLINK struct {1106Nmhdr NMHDR
1107Msg uint321108WParam uintptr1109LParam uintptr1110Chrg CHARRANGE
1111}
1112
1113type ENLOWFIRTF struct {1114Nmhdr NMHDR
1115SzControl *byte1116}
1117
1118// PenWin specific
1119type ENCORRECTTEXT struct {1120Nmhdr NMHDR
1121Chrg CHARRANGE
1122Seltyp uint161123}
1124
1125// East Asia specific
1126type PUNCTUATION struct {1127ISize uint321128SzPunctuation *byte1129}
1130
1131// East Asia specific
1132type COMPCOLOR struct {1133CrText COLORREF
1134CrBackground COLORREF
1135DwEffects uint321136}
1137
1138const (1139// Clipboard formats - use as parameter to RegisterClipboardFormat()1140CF_RTF = "Rich Text Format"1141CF_RTFNOOBJS = "Rich Text Format Without Objects"1142CF_RETEXTOBJ = "RichEdit Text and Objects"1143)
1144
1145// Paste Special
1146type REPASTESPECIAL struct {1147DwAspect uint321148DwParam uintptr1149}
1150
1151// UndoName info
1152type UNDONAMEID int321153
1154const (1155UID_UNKNOWN UNDONAMEID = 01156UID_TYPING = 11157UID_DELETE = 21158UID_DRAGDROP = 31159UID_CUT = 41160UID_PASTE = 51161UID_AUTOTABLE = 61162)
1163
1164const (1165// Flags for the SETEXTEX data structure1166ST_DEFAULT = 01167ST_KEEPUNDO = 11168ST_SELECTION = 21169ST_NEuint16S = 41170ST_UNICODE = 81171)
1172
1173// EM_SETTEXTEX info; this struct is passed in the wparam of the message
1174type SETTEXTEX struct {1175Flags uint32 // Flags (see the ST_XXX defines)1176Codepage uint32 // Code page for translation (CP_ACP for sys default, 1200 for Unicode, -1 for control default)1177}
1178
1179const (1180// Flags for the GETEXTEX data structure1181GT_DEFAULT = 01182GT_USECRLF = 11183GT_SELECTION = 21184GT_RAWTEXT = 41185GT_NOHIDDENTEXT = 81186)
1187
1188// EM_GETTEXTEX info; this struct is passed in the wparam of the message
1189type GETTEXTEX struct {1190Cb uint32 // Count of bytes in the string1191Flags uint32 // Flags (see the GT_XXX defines1192Codepage uint32 // Code page for translation (CP_ACP for sys default, 1200 for Unicode, -1 for control default)1193LpDefaultChar *byte // Replacement for unmappable chars1194LpUsedDefChar *BOOL // Pointer to flag set when def char used1195}
1196
1197const (1198// Flags for the GETTEXTLENGTHEX data structure1199GTL_DEFAULT = 0 // Do default (return # of chars)1200GTL_USECRLF = 1 // Compute answer using CRLFs for paragraphs1201GTL_PRECISE = 2 // Compute a precise answer1202GTL_CLOSE = 4 // Fast computation of a "close" answer1203GTL_NUMCHARS = 8 // Return number of characters1204GTL_NUMBYTES = 16 // Return number of _bytes_1205)
1206
1207// EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg
1208type GETTEXTLENGTHEX struct {1209Flags uint32 // Flags (see GTL_XXX defines)1210Codepage uint32 // Code page for translation (CP_ACP for default, 1200 for Unicode)1211}
1212
1213// BiDi specific features
1214type BIDIOPTIONS struct {1215CbSize uint321216WMask uint161217WEffects uint161218}
1219
1220const (1221// BIDIOPTIONS masks1222BOM_NEUTRALOVERRIDE = 0x0004 // Override neutral layout (obsolete)1223BOM_CONTEXTREADING = 0x0008 // Context reading order1224BOM_CONTEXTALIGNMENT = 0x0010 // Context alignment1225BOM_LEGACYBIDICLASS = 0x0040 // Legacy Bidi classification (obsolete)1226BOM_UNICODEBIDI = 0x0080 // Use Unicode BiDi algorithm1227
1228// BIDIOPTIONS effects1229BOE_NEUTRALOVERRIDE = 0x0004 // Override neutral layout (obsolete)1230BOE_CONTEXTREADING = 0x0008 // Context reading order1231BOE_CONTEXTALIGNMENT = 0x0010 // Context alignment1232BOE_FORCERECALC = 0x0020 // Force recalc and redraw1233BOE_LEGACYBIDICLASS = 0x0040 // Legacy Bidi classification (obsolete)1234BOE_UNICODEBIDI = 0x0080 // Use Unicode BiDi algorithm1235
1236// Additional EM_FINDTEXT[EX] flags1237FR_MATCHDIAC = 0x200000001238FR_MATCHKASHIDA = 0x400000001239FR_MATCHALEFHAMZA = 0x800000001240
1241// UNICODE embedding character1242WCH_EMBEDDING uint16 = 0xFFFC1243)
1244
1245// khyph - Kind of hyphenation
1246type KHYPH int321247
1248const (1249KhyphNil KHYPH = iota // No Hyphenation1250KhyphNormal // Normal Hyphenation1251KhyphAddBefore // Add letter before hyphen1252KhyphChangeBefore // Change letter before hyphen1253KhyphDeleteBefore // Delete letter before hyphen1254KhyphChangeAfter // Change letter after hyphen1255KhyphDelAndChange // Delete letter before hyphen and change letter preceding hyphen1256)
1257
1258type HYPHRESULT struct {1259Khyph KHYPH // Kind of hyphenation1260IchHyph int32 // Character which was hyphenated1261ChHyph uint16 // Depending on hyphenation type, character added, changed, etc.1262}
1263
1264type HYPHENATEINFO struct {1265CbSize int16 // Size of HYPHENATEINFO structure1266DxHyphenateZone int16 // If a space character is closer to the margin than this value, don't hyphenate (in TWIPs)1267PfnHyphenate uintptr1268}
1269
1270const (1271// Additional class for Richedit 6.01272RICHEDIT60_CLASS = "RICHEDIT60W"1273)
1274