All pastes #548661 Raw Edit

SupraFast

public cpp v1 · immutable
·published 2007-06-07 20:19 UTC
rendered paste body
void displayAndAutoScrollRichEdit(HWND rEdit, char temp[], COLORREF rgbColor){	CHARFORMAT d;	GETTEXTLENGTHEX h;	int min;	int max;	int i;	int f;	CHARRANGE b;	//Move Caret to Bottom	b.cpMin = -1;	b.cpMax = -1;	SendMessage(rEdit, EM_EXSETSEL, 0, (LPARAM)&b);	//Set Text Properties	d.cbSize = sizeof(CHARFORMAT);	d.crTextColor = rgbColor;	d.dwEffects = 0;	d.dwMask = CFM_COLOR;	SendMessage(rEdit, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &d);	GetScrollRange(rEdit,	SB_VERT, &min, &max);	i = GetScrollPos(rEdit, SB_VERT);		//Display	SendMessage(rEdit, EM_REPLACESEL, 0, (LPARAM) temp);		//Height	if(rEdit == txtChatroom)		f = 260;	else		f = 115;	//Auto Scroll	if((i + f) >= max)		SendMessage(rEdit, WM_VSCROLL, SB_BOTTOM, 0);}