00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022
00023
00024 #include "stdafx.h"
00025
00026 #include "OutputView.h"
00027
00028 LRESULT COutputView::OnCreate(UINT , WPARAM , LPARAM , BOOL& bHandled)
00029 {
00030 PARAFORMAT2 pf;
00031 pf.cbSize = sizeof(pf);
00032 pf.dwMask = PFM_ALL2;
00033 GetParaFormat(pf);
00034 pf.dwMask = PFM_OFFSET;
00035 pf.dxOffset = 200;
00036 SetParaFormat(pf);
00037
00038 SetAutoURLDetect(TRUE);
00039 SetEventMask(ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_SELCHANGE | ENM_LINK | ENM_SCROLL | ENM_SCROLLEVENTS);
00040
00041 bHandled = FALSE;
00042
00043 return 0;
00044 }
00045 BOOL COutputView::PreTranslateMessage(MSG* pMsg)
00046 {
00047 pMsg;
00048 return FALSE;
00049 }
00050
00051 void COutputView::WriteMsg(LPCTSTR lpszNewText, CHARFORMAT2 *pcFmt)
00052 {
00053 SetRedraw(FALSE);
00054 SetSel(-1,-1);
00055 SetSelectionCharFormat(*pcFmt);
00056 ReplaceSel(lpszNewText);
00057 SendMessage(WM_VSCROLL, SB_BOTTOM, NULL);
00058 SetSel(-1,-1);
00059 SetRedraw(TRUE);
00060 RedrawWindow();
00061 }