Programming - cpueblo.com

ShowMessage 구현. Rich Edit 에서 색상이랑 출력 시간 기록, 서버에서 사용함


글쓴이 : 유광희 날짜 : 2002-06-21 (금) 16:16 조회 : 15559
void TfrmeWannyConsoleLog :: ShowMessage(String Message, bool ShowTime, int TextColor)
{
	TListItem *Item;
	MessageLog->SelAttributes->Color = (TColor)TextColor;
	String strTmp;

	// 1000 행이 넘어가면 라인을 모두 삭제. 안그러면 후에 엄청난 버벅거림을~
	if (MessageLog->Lines->Count > 1000)
		MessageLog->Lines->Clear();

	if (ShowTime == true)	strTmp = FormatDateTime("yyyy-mm-dd hh:mm:ss - ", Now()) + Message;
	else			strTmp = Message;

	MessageLog->Lines->Add(strTmp);

	if (FileLog)
		FileLog->WriteLog(strTmp);
}