Author: majkinetor, freakkk Last Modified: nonexistent
This module allows you to create and programmatically set text properties in rich edit control. Besides that, it contains functions that work with standard edit controls.
RichEdit("oldNotify", RegisterCallback(oldNotify)
RichEdit_Add(HParent, X="", Y="", W="", H="", Style="", Text="")
RichEdit_add2Form(hParent, Txt, Opt)
RichEdit_AutoUrlDetect(HCtrl, Flag="" )
RichEdit_CanPaste(hEdit, ClipboardFormat=0x1)
RichEdit_CharFromPos(hEdit,X,Y)
RichEdit_Clear(hEdit)
RichEdit_Convert(Input, Direction=0)
RichEdit_Copy(hEdit)
RichEdit_Cut(hEdit)
RichEdit_editStreamCallBack(dwCookie, pbBuff, cb, pcb)
RichEdit_FindText(hEdit, Text, CpMin=0, CpMax=-1, Flags="UNICODE")
RichEdit_FindWordBreak(hCtrl, CharIndex, Flag="")
RichEdit_FixKeys(hCtrl)
RichEdit_GetCharFormat(hRichEdit, face, style, color)
RichEdit_GetLine(hEdit, LineNumber=-1)
RichEdit_GetLineCount(hEdit)
RichEdit_GetModify(hEdit)
RichEdit_GetOptions(hCtrl)
RichEdit_GetParaFormat(hCtrl)
RichEdit_GetRect(hEdit,ByRef Left="",ByRef Top="",ByRef Right="",ByRef Bottom="")
RichEdit_GetRedo(hCtrl, ByRef name="-")
RichEdit_GetSel(hRichEdit, min, max)
RichEdit_GetText(HCtrl, CpMin="-", CpMax="-", CodePage="")
RichEdit_GetTextLength(hCtrl, Flags=0, CodePage="")
RichEdit_GetUndo(hCtrl, ByRef Name="-")
RichEdit_HideSelection( hRichEdit, false )
RichEdit_LimitText(hCtrl,txtSize=0)
RichEdit_LineFromChar(hCtrl, CharIndex=-1)
RichEdit_LineIndex(hEdit, LineNumber=-1)
RichEdit_LineLength(hEdit, LineNumber=-1)
RichEdit_LineScroll(hEdit,XScroll=0,YScroll=0)
RichEdit_onNotify(Wparam, Lparam, Msg, Hwnd)
RichEdit_PageRotate(hCtrl, R="")
RichEdit_Paste( hRichEdit )
RichEdit_PasteSpecial(HCtrl, Format)
RichEdit_PosFromChar(hEdit, CharIndex, ByRef X, ByRef Y)
RichEdit_Redo(hEdit)
RichEdit_ReplaceSel(hEdit, Text="")
RichEdit_Save( hRichEdit, file )
RichEdit_ScrollCaret(hEdit)
RichEdit_ScrollPos(HCtrl, PosString="" )
RichEdit_SelectionType(hCtrl)
RichEdit_SetBgColor(hCtrl, Color)
RichEdit_SetCharFormat(HCtrl, Face="", Style="", TextColor="", BackColor="", Mode="SELECTION")
RichEdit_SetEditStyle(hCtrl, Style)
RichEdit_SetEvents(hCtrl, Handler="", Events="selchange")
RichEdit_SetFontSize(hCtrl, Add)
RichEdit_SetModify( hRichEdit, false )
RichEdit_SetOptions(hCtrl, Operation, Options)
RichEdit_SetParaFormat(hCtrl, o1="", o2="", o3="", o4="", o5="", o6="")
RichEdit_SetSel(hRichEdit, pos, pos+StrLen(FindText)
RichEdit_SetText(hRichEdit, file, "FROMFILE KEEPUNDO")
RichEdit_SetUndoLimit(hCtrl, nMax)
RichEdit_ShowScrollBar(hCtrl, Bar, State=true)
RichEdit_TextMode(HCtrl, TextMode="")
RichEdit_Undo(hCtrl, Reset=false)
RichEdit_wndProc(hwnd, uMsg, wParam, lParam)
RichEdit_WordWrap(HCtrl, Flag)
Richedit_Zoom(hCtrl, zoom=0)
For more details of the functions's parameters and return value, please see it's source code.
This module is part of the Forms Framework package.
MSDN Reference: http://msdn.microsoft.com/en-us/library/bb787605(VS.85).aspx.
For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/viewtopic.php?t=53317
The functions is an open source item under the BSD license. For details, please see http://creativecommons.org/licenses/BSD/
; #Include RichEdit.ahk #NoEnv SendMode Input SetWorkingDir %A_ScriptDir% SetKeyDelay, 20, 20 Gui, +LastFound hwnd := WinExist() hRichEdit := RichEdit_Add(hwnd, 5, 5, 200, 300) RichEdit_SetBgColor(hRichEdit, "0x661122") RichEdit_SetCharFormat(hRichEdit, "courier new", "bold", "0x3366ff", "0x333333") Gui, Show, w210 h310 BlockInput, Send Sleep, 500 SendEvent, RichEdit BlockInput, Off Return GuiClose: ExitApp