Inserts text at the current caret position, applying current format.
Takes richTextBoxID (Int) and text (String).
Returns 1 on success, 0 if rich text box not found.
BGI GUI
Parameters & Returns
Parameters
richTextBoxIDInt
textString
Returns
Int
Quick Summary
Inserts text at the current caret position, applying current format.
Takes richTextBoxID (Int) and text (String).
Returns 1 on success, 0 if rich text box not found.
Technical Exegesis...
Inserts text at the current caret position in a rich text box, applying stored format if set. Searches gizmoMap for the rich text box ID. Converts input string from UTF-8 to wide string. Gets current selection range with EM_EXGETSEL, records start position (cpMin). Inserts text with EM_REPLACESEL (TRUE for undo support) - replaces selection if any, otherwise inserts at caret.
Inserts text at the current caret position in a rich text box, applying stored format if set. Searches gizmoMap for the rich text box ID. Converts input string from UTF-8 to wide string. Gets current selection range with EM_EXGETSEL, records start position (cpMin). Inserts text with EM_REPLACESEL (TRUE for undo support) - replaces selection if any, otherwise inserts at caret. If format previously set via bgiSetRichTextFormat, retrieves stored CHARFORMATW from richTextFormatMap, selects newly inserted text range, applies format with EM_SETCHARFORMAT (SCF_SELECTION), then moves caret to end of inserted text. Returns 1 on success, 0 if rich text box not found.
This function inserts text at the cursor position (or replaces selection if text is selected). If bgiSetRichTextFormat was called first, the stored format (bold, italic, color, font, size) is applied to the inserted text. If no format set, text uses current typing format. Unlike bgiAppendRichText (adds to end), this inserts at current position. Use for programmatic text editing, autocomplete, or template insertion. Supports undo (EM_REPLACESEL with TRUE).