TE Edit Control Win32 / Win64 Help
Product page

SetTerColor

Set text color

BOOL SetTerColor(hWnd, COLORREF color, repaint)
HWND hWnd;The handle of the window to be accessed
COLORREF color;new color to apply
BOOL repaint;TRUE to refresh the window after this operation

Description: This function is used to apply the new color to the text. If a text block is highlighted, this operation is applicable to all characters in the block. Otherwise the new color is selected for the next character input.

Return Value: This function returns TRUE if successful.

Example:

SelectTerText(hWnd,0,0,0,40,FALSE); // select the first 40 characters of the first line.

SetTerColor(hWnd,0x00FF00,TRUE); // apply green color to the selected text