Hello everybody, I'm a bit confused since I can't color anything in the mIRC Script's Richedit.

I've successfully done this with an own program.

Here is my fuction:
Code:
void ColorText(int min, int max, COLORREF color) {
	CHARFORMAT cf;
	cf.cbSize      = sizeof(CHARFORMAT);
	cf.dwMask      = CFM_COLOR | CFM_UNDERLINE | CFM_BOLD;
	cf.dwEffects   = (unsigned long)~(CFE_AUTOCOLOR | CFE_UNDERLINE | CFE_BOLD);
	cf.crTextColor = color;
	SendMessage(hWndEdit, EM_SETSEL, (WPARAM)(int)min, (LPARAM)(int)max);
	SendMessage(hWndEdit, EM_SETCHARFORMAT, (WPARAM)(UINT)SCF_SELECTION, (LPARAM)&cf);
}
Note: hWndEdit is the handle to mse's richedit.

EM_SETSEL works fine with mse, but EM_SETCHARFORMAT doesn't seems to work (return 0 & GetLastError() = 6).

Thank you