2 #include "nlite_include.h"
3 using namespace std::tr1;
7 static const LPCTSTR LIVEURL_PART = TEXT("http://live.nicovideo.jp/watch/");
8 static const LPCTSTR ADDMYLIST_PART = TEXT("http://www.nicovideo.jp/mylist_add/video/");
10 static const UINT_PTR SELL_SPACE_LENGTH = 1;
12 //
\83R
\83\81\83\93\83g
\83r
\83\85\81[
\93à
\82Ì
\83R
\83\93\83g
\83\8d\81[
\83\8b\83N
\83\89\83X
13 ///////////////////////////////////////////////////////////////////
15 CChatReadEdit::CChatReadEdit(CCommentView &m_master):m_master(m_master){
20 BOOL CChatReadEdit::SetWindowText(const CChatData &chat){
25 tstring viewString(regex_replace(tstring(chat.chatBuf),nliteregex::TAGSTRING,nliteregex::text::NUTHINGSTRING));
26 rslt = __super::SetWindowText(viewString.c_str());
28 CHARFORMAT2 defaultFormat;
29 this->GetDefaultCharFormat(defaultFormat);
30 defaultFormat.dwMask |= CFM_COLOR;
31 if(chat.premium == 2 || chat.premium == 3){
33 defaultFormat.crTextColor = m_master.viewproperty.ownerStringColor;
38 defaultFormat.crTextColor = m_master.viewproperty.baseStringColor;
42 BOOL rslt = this->SetDefaultCharFormat(defaultFormat);
46 linkStringBeside(viewString,nliteregex::LILNKREGEX);
50 } catch(std::exception &e){
60 VOID CChatReadEdit::linkStringBeside(const tstring &target,const nliteregex::tregex &re){
62 match_results<tstring::const_iterator> regexRslt;
63 tstring::const_iterator beginStr = target.begin();
64 tstring::const_iterator endstr = target.end();
66 cf.cbSize = sizeof(cf);
68 cf.dwEffects = CFE_LINK;
69 INT_PTR basePosition = 0;
70 while(regex_search(beginStr,endstr,regexRslt,re)){
71 basePosition += regexRslt.position(0);
72 this->SetSel(basePosition,basePosition + regexRslt.length());
73 this->SetCharFormat(cf,SCF_SELECTION);
74 basePosition += regexRslt.length();
76 beginStr = regexRslt[0].second;
81 VOID CChatReadEdit::Reset(){
83 __super::SetWindowText(TEXT(""));
88 HWND CChatReadEdit::GeneralCreate(HWND hParent,DWORD eventMask,UINT id){
91 this->Create(hParent,0,RICHEDIT_CLASS,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | ES_AUTOVSCROLL | ES_MULTILINE | ES_READONLY,0,id);
93 DWORD dwLangOptons = this->SendMessage(EM_GETLANGOPTIONS,0,0);
94 dwLangOptons &= ~IMF_DUALFONT;
95 this->SendMessage(EM_SETLANGOPTIONS,0,(LPARAM)dwLangOptons);
98 CFont defFont = ::AtlGetDefaultGuiFont();
100 defFont.GetLogFont(&deflogFont);
101 CHARFORMAT2 m_defCharFormat;
102 this->GetDefaultCharFormat(m_defCharFormat);
103 CDC cDC = this->GetDC();
104 int picy = cDC.GetDeviceCaps(LOGPIXELSY);
105 this->ReleaseDC(cDC.m_hDC);
106 int point = -MulDiv(deflogFont.lfHeight,72,picy);
107 int twips = point * 20;
108 m_defCharFormat.yHeight = twips;
109 m_defCharFormat.dwEffects ^= CFE_AUTOCOLOR;
110 _tcscpy(m_defCharFormat.szFaceName,deflogFont.lfFaceName);
111 this->SetEventMask(eventMask);
113 this->SetDefaultCharFormat(m_defCharFormat);
120 CChatChildCtrls::CChatChildCtrls(CCommentView &hMaster):
122 chatDispCtrl(hMaster)
130 VOID CChatChildCtrls::Create(){
132 this->chatDispCtrl.GeneralCreate(m_master.m_commentListWindow,ENM_LINK | ENM_MOUSEEVENTS,CHAT_DISPCTRL_ID);
136 VOID CChatChildCtrls::AdjustRect(RECT &rc){
138 rc.left += SELL_SPACE_LENGTH;
139 rc.top += SELL_SPACE_LENGTH;
140 rc.right -= SELL_SPACE_LENGTH;
141 rc.bottom -= SELL_SPACE_LENGTH;
146 VOID CChatChildCtrls::Hide(HDWP hdwp){
148 chatDispCtrl.DeferWindowPos(hdwp,chatDispCtrl,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_HIDEWINDOW);
152 VOID CChatChildCtrls::SetCtrl(HDWP hdwp,const RECT &rc,CCommentList::reference comment,BOOL mulutiLineFlag){
155 chatDispCtrl.SetWindowText(comment);
159 AdjustRect(chatRect);
163 if (comment.viewData.selectFlag == TRUE)
165 bkColor = m_master.viewproperty.selectBackColor;
172 if(comment.viewData.backColor != CChatData::ViewData::INIT_COLOR){
174 bkColor = comment.viewData.backColor;
176 }else if(comment.listenerData->bgcolor != ListenerData::INIT_COLOR){
178 bkColor = comment.listenerData->bgcolor;
183 bkColor = m_master.viewproperty.backColor;
191 chatDispCtrl.SetBackgroundColor(bkColor);
193 chatDispCtrl.DeferWindowPos(hdwp,NULL,chatRect.left,chatRect.top,chatRect.right - chatRect.left ,chatRect.bottom - chatRect.top, SWP_NOZORDER | SWP_SHOWWINDOW);
198 UINT_PTR CChatChildCtrls::GetCtrlCount(){
206 ///
\83R
\83\93\83X
\83g
\83\89\83N
\83^
208 CChatChildCtrlsList::CChatChildCtrlsList(CCommentView &hMaster):m_hMaster(hMaster){
216 ///
\83R
\83\93\83g
\83\8d\81[
\83\8b\82ð
\95\
\8e¦
218 VOID CChatChildCtrlsList::ShowCntrls(){
225 if(m_hMaster.commentlist.Size() > 0){
232 m_hMaster.m_commentListWindow.GetClientRect(&listRect);
233 m_hMaster.m_header.GetItemRect(CCommentView::COMMENT,&headerRect);
235 headerRect.bottom = 0;
237 UINT_PTR counter = 0;
238 INT_PTR heightSum =0;
240 auto ctrlsBegin = m_list.begin();
241 auto ctrlsEnd = m_list.end();
242 auto chatDataBegin = m_hMaster.commentlist.GetShortCut();
243 auto chatDataEnd = m_hMaster.commentlist.end();
244 auto chatDataTmp = chatDataBegin;
245 for(;chatDataBegin != chatDataEnd && heightSum < listRect.bottom;++chatDataBegin){
246 m_hMaster.m_commentListWindow.CalcItemHeight(*chatDataBegin);
248 heightSum += chatDataBegin->viewData.height;
253 chatDataBegin = chatDataTmp;
255 HDWP hdwp = ::BeginDeferWindowPos(CChatChildCtrls::GetCtrlCount() * (counter > m_list.size() ? counter : m_list.size()));
256 for(; chatDataBegin != chatDataEnd && counter > 0 ;++ctrlsBegin,++chatDataBegin,--counter){
259 tmpRect = headerRect;
260 tmpRect.top += heightSum;
261 tmpRect.bottom += heightSum + chatDataBegin->viewData.height;
263 if(ctrlsBegin == ctrlsEnd)ctrlsBegin = Extend();
265 ctrlsBegin->SetCtrl(hdwp,tmpRect,*chatDataBegin,m_hMaster.viewproperty.commentFoldingFlag);
267 heightSum = tmpRect.bottom;
272 for(;ctrlsBegin != ctrlsEnd;++ctrlsBegin){
274 ctrlsBegin->Hide(hdwp);
277 ::EndDeferWindowPos(hdwp);
287 VOID CChatChildCtrlsList::AllHide(){
289 auto begin =m_list.begin();
290 auto end = m_list.end();
292 HDWP hdwp = ::BeginDeferWindowPos(CChatChildCtrls::GetCtrlCount() * m_list.size());
293 for(;begin != end;++begin){
296 ::EndDeferWindowPos(hdwp);
301 ///
\8ag
\92£
\8f\88\97\9d
303 CChatChildCtrlsList::iterator CChatChildCtrlsList::Extend(){
306 CChatChildCtrls ctrls(m_hMaster);
308 m_list.push_back(ctrls);
309 m_list.back().Create();
310 auto ite = (--m_list.end());
317 //
\83R
\83\81\83\93\83g
\83r
\83\85\81[
\83N
\83\89\83X
\83\81\83\
\83b
\83h
318 ///////////////////////////////////////////////////////
320 CCommentView::CCommentView(CNicoLiveStream &stream,CNicoVideoAuth &in_refAuth):
321 m_commentListWindow(*this),
324 ,chatChildCtrlsList(*this)
330 lf.lfCharSet = SHIFTJIS_CHARSET;
333 hHeaderFontNew = CreateFontIndirect(&lf);
340 CCommentView::~CCommentView(){
343 DeleteObject(hHeaderFontNew);
348 VOID CCommentView::UpDateUI(){
350 this->chatChildCtrlsList.ShowCntrls();
351 this->m_commentListWindow.Invalidate();
356 VOID CCommentView::OnConnect(){
357 m_commentListWindow.SetRedraw(FALSE);
358 m_commentListWindow.ResetViewSellHeight();
360 chatChildCtrlsList.AllHide();
363 commentlist.OnConnect();
365 SCROLLINFO vScrollInfo = {0};
366 vScrollInfo.cbSize = sizeof(vScrollInfo);
367 vScrollInfo.fMask = SIF_ALL;
369 this->SetScrollInfo(SB_VERT,&vScrollInfo,FALSE);
371 m_commentListWindow.SetRedraw(TRUE);
372 m_commentListWindow.Invalidate();
379 UINT_PTR CCommentView::GetColumnHolSizeSum(){
383 this->GetScrollRange(SB_HORZ,&nMin,&nMax);
388 VOID CCommentView::SetProperty(const CommentViewProperty &setProperty,const GeneralProperty &in_generalProperty){
391 viewproperty = setProperty;
392 generalProperty = in_generalProperty;
393 m_commentListWindow.OnSetProperty();
398 CommentViewProperty &CCommentView::GetProperty(){
408 HWND CCommentView::Create(HWND hWndParent){
412 HWND rslt = __super::Create(hWndParent,0,commentViewConstant::NLITE_COMMENTVIEW,WS_VISIBLE | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_BORDER,0,commentViewConstant::MENU_OR_ID);
415 HDC hdc = m_header.BeginPaint(&ps);
418 HFONT hOld = (HFONT)SelectObject(hdc,hHeaderFontNew);
420 LPTSTR columns[] = {TEXT("
\83R
\83\81\94Ô"),TEXT("
\83\86\81[
\83U
\81[
\96¼"),TEXT("
\83R
\83\81\83\93\83g"),TEXT("
\8e\9e\8aÔ"),TEXT("
\8fî
\95ñ")};
421 UINT_PTR holizenSize[] = {0,0,100,0,0};
423 for(UINT_PTR index = 0;index < ARRAY_LENGTH(columns) ;++index){
425 GetTextExtentPoint32(hdc , columns[index] , _tcslen(columns[index]) , &size);
426 UINT_PTR holsize = holizenSize[index] + size.cx + 15;
427 holizenSize[index] = viewproperty.headerholSize[index] >= 0 ? viewproperty.headerholSize[index] : holsize;
430 SelectObject(hdc,hOld);
432 m_header.EndPaint(&ps);
435 HEADERSINFO headersinfo = {columns,holizenSize,ARRAY_LENGTH(columns)};
437 AddHeader(&headersinfo);
439 m_header.SetOrderArray(ARRAY_LENGTH(viewproperty.headerOrderArray),viewproperty.headerOrderArray);
450 LRESULT CCommentView::OnHeaderEndTrack(LPNMHDR lParam){
453 if(lParam->hwndFrom == m_header.m_hWnd){
456 auto begin = commentlist.begin();
458 auto end = commentlist.end();
460 for(;begin != end;++begin){
462 begin->viewData.height = 0;
466 m_commentListWindow.SetRedraw(FALSE);
467 SCROLLINFO vScrollInfo = {0};
468 vScrollInfo.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
470 this->GetScrollInfo(SB_VERT,&vScrollInfo);
471 vScrollInfo.nPage = m_commentListWindow.CalcScrollPage(vScrollInfo.nMax);
472 vScrollInfo.fMask = SIF_PAGE;
473 this->SetScrollInfo(SB_VERT,&vScrollInfo);
475 BOOL scrollFlag = vScrollInfo.nPos + (int)vScrollInfo.nPage + 1>= vScrollInfo.nMax;
476 UINT_PTR commentCount = commentlist.Size();
477 LPNMHEADER lpNmHdr = (LPNMHEADER )lParam;
479 m_header.SetItem(lpNmHdr->iItem,lpNmHdr->pitem);
487 if(scrollFlag == TRUE){
489 this->m_commentListWindow.SendMessageW(WM_VSCROLL,MAKELONG(SB_BOTTOM,0),0);
492 INT_PTR itemCount = m_header.GetItemCount();
496 for(INT_PTR itemIndex = 0;itemIndex < itemCount;itemIndex++){
497 m_header.GetItemRect(itemIndex,&itemSizeRect);
498 nMax += itemSizeRect.right - itemSizeRect.left;
502 this->SetScrollRange(SB_HORZ,nMin,nMax,TRUE);
508 m_commentListWindow.SetRedraw(TRUE);
510 m_commentListWindow.Invalidate();
511 this->m_commentListWindow.SendMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
518 VOID CCommentView::OnChatReceve(NicoLiveChat_P chat,UINT_PTR commnetCountSum){
521 commentlist.OnChatReceve(chat,stream.GetDefaultCommunity(),commnetCountSum,this->m_commentListWindow);
527 VOID CCommentView::OnChatReceveSettle(UINT_PTR chatNo,UINT_PTR commentCountSum){
530 SCROLLINFO vScrollInfo = {0};
533 vScrollInfo.fMask = SIF_ALL;
535 this->GetScrollInfo(SB_VERT,&vScrollInfo);
536 BOOL scrollFlag = vScrollInfo.nPos + (int)vScrollInfo.nPage >= vScrollInfo.nMax;
538 vScrollInfo.cbSize = sizeof(vScrollInfo);
539 vScrollInfo.nMax = commentCountSum;
540 vScrollInfo.fMask = SIF_RANGE | SIF_PAGE;
541 vScrollInfo.nPage = m_commentListWindow.CalcScrollPage(vScrollInfo.nMax);
544 this->SetScrollInfo(SB_VERT,&vScrollInfo,FALSE);
549 if(scrollFlag == TRUE){
550 this->PostMessage(WM_VSCROLL,MAKEWORD(SB_BOTTOM,0),0);
554 if(vScrollInfo.nPos + static_cast<INT_PTR>(vScrollInfo.nPage) >= vScrollInfo.nMax - static_cast<INT_PTR>(vScrollInfo.nPage)){
555 m_commentListWindow.Invalidate();
558 this->m_commentListWindow.PostMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
564 static UCHAR getrgb(){
566 UCHAR rgb = 192 + rand() % 64;
580 LRESULT CCommentView::OnSize(UINT wParam,SIZE lParam){
587 VOID CCommentView::ChangeSize(const SIZE& client){
589 SCROLLINFO hScrollInfo = {0};
590 hScrollInfo.cbSize = sizeof(hScrollInfo);
591 hScrollInfo.fMask = SIF_PAGE;
592 hScrollInfo.nPage = client.cx;
594 this->SetScrollInfo(SB_HORZ,&hScrollInfo);
595 hScrollInfo.fMask = SIF_ALL;
596 this->GetScrollInfo(SB_HORZ,&hScrollInfo);
599 HDWP hDwp = BeginDeferWindowPos(2);
602 INT_PTR movePos = -1 * hScrollInfo.nPos;
604 m_header.DeferWindowPos(hDwp,m_header.m_hWnd,movePos,0,0,0,SWP_NOSIZE | SWP_NOZORDER);
605 m_commentListWindow.DeferWindowPos(hDwp,m_commentListWindow.m_hWnd,movePos,commentViewConstant::HEADER_HAIGHT,::GetSystemMetrics(SM_CXFULLSCREEN),client.cy - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER);
607 EndDeferWindowPos(hDwp);
612 m_header.GetWindowRect(&headerRectSize);
613 bkRect.left = headerRectSize.right - headerRectSize.left - hScrollInfo.nPos;
615 bkRect.right = client.cx ;
616 bkRect.bottom = client.cy;
624 LRESULT CCommentView::OnClickChatNo(UINT uMsg,WPARAM wParam,LPARAM lParam){
627 ::SendMessage(::GetAncestor(*this,GA_ROOT),uMsg,wParam,lParam);
633 LRESULT CCommentView::OnClickUserName(UINT uMsg,WPARAM wParam,LPARAM lParam){
636 ::SendMessage(::GetAncestor(*this,GA_ROOT),uMsg,wParam,lParam);
641 LRESULT CCommentView::OnEraseBkgnd(HDC wParam){
647 VOID CCommentView::OnDestroy(){
648 m_header.GetOrderArray(ARRAY_LENGTH(viewproperty.headerOrderArray),viewproperty.headerOrderArray);
649 INT_PTR headerItemcount = m_header.GetItemCount();
651 for(INT_PTR itemindex = 0;itemindex < headerItemcount;itemindex++){
653 m_header.GetItemRect(itemindex,&headerItemRect);
654 viewproperty.headerholSize[itemindex] = headerItemRect.right - headerItemRect.left;
656 commentlist.OnDestroy();
657 m_header.DestroyWindow();
658 m_commentListWindow.DestroyWindow();
663 LRESULT CCommentView::OnHeaderEndDrag(LPNMHDR lParam){
665 if(lParam->hwndFrom == m_header.m_hWnd){
667 LPNMHEADER pNMHeader = (LPNMHEADER) lParam;
668 this->m_header.SetItem(pNMHeader->iItem,pNMHeader->pitem);
670 m_commentListWindow.Invalidate();
671 this->m_commentListWindow.SendMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
679 VOID CCommentView::OnHScroll(INT_PTR loWParam,SHORT hiWParam,HWND lParam){
683 SCROLLINFO hScrollInfo = {0};
684 hScrollInfo.cbSize = sizeof(hScrollInfo);
685 hScrollInfo.fMask = SIF_ALL;
686 this->GetScrollInfo(SB_HORZ,&hScrollInfo);
689 case SB_THUMBPOSITION:
691 dy = hiWParam - hScrollInfo.nPos;
697 dy = -1 * hScrollInfo.nPage;
704 dy = hScrollInfo.nPage + hScrollInfo.nPos > (UINT_PTR)hScrollInfo.nMax ? 0 :(UINT_PTR) (hScrollInfo.nMax - ( hScrollInfo.nPage + hScrollInfo.nPos)) < hScrollInfo.nPage ? (hScrollInfo.nMax - ( hScrollInfo.nPage + hScrollInfo.nPos)) : hScrollInfo.nPage;
714 dy = max(-1 * hScrollInfo.nPos, min(dy, hScrollInfo.nMax - hScrollInfo.nPos));
718 hScrollInfo.nPos += dy;
719 INT_PTR moveRange = -(hScrollInfo.nPos);
721 HDWP hDwp = BeginDeferWindowPos(2);
723 m_header.DeferWindowPos(hDwp,m_header.m_hWnd,moveRange,0,0,0,SWP_NOSIZE | SWP_NOZORDER);
724 m_commentListWindow.DeferWindowPos(hDwp,m_commentListWindow.m_hWnd,moveRange,commentViewConstant::HEADER_HAIGHT,0,0,SWP_NOSIZE | SWP_NOZORDER);
726 EndDeferWindowPos(hDwp);
729 this->SetScrollInfo(SB_HORZ,&hScrollInfo);
736 VOID CCommentView::OnVScroll(INT_PTR loWParam,SHORT hiWParam,HWND lParam){
739 SCROLLINFO vScrollInfo = {0};
740 vScrollInfo.fMask = SIF_ALL;
743 this->GetScrollInfo(SB_VERT,&vScrollInfo);
748 case SB_THUMBPOSITION:
751 dy = hiWParam - vScrollInfo.nPos;
768 dy = -1 * vScrollInfo.nPage;
774 dy = vScrollInfo.nPage;
781 dy = -vScrollInfo.nPos;
787 dy = vScrollInfo.nMax;
804 vScrollInfo.nPos += dy;
805 // viewStartHeight = vScrollInfo.nPos;
806 this->SetScrollPos(SB_VERT,vScrollInfo.nPos);
807 this->commentlist.SetShortCut(this->GetScrollPos(SB_VERT));
808 //this->SetScrollInfo(SB_VERT,&vScrollInfo);
809 this->UpdateWindow();
811 m_commentListWindow.Invalidate();
812 this->m_commentListWindow.SendMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
820 LRESULT CCommentView::OnCreate(LPCREATESTRUCT lpcs){
821 m_header.Create(m_hWnd,0,WC_HEADER,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | HDS_BUTTONS | HDS_HOTTRACK |HDS_DRAGDROP | HDS_FULLDRAG ,0,commentViewConstant::HEADER_ID);
822 m_commentListWindow.Create(m_hWnd,0,commentViewConstant::NLITE_COMMENTLISTWINDOW,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN , 0,commentViewConstant::LISTWINDOW);
829 VOID CCommentView::AddHeader(LPHEADERSINFO infos){
832 m_header.SetFont(hHeaderFontNew);
835 item.mask = HDI_FORMAT | HDI_TEXT | HDI_WIDTH;
836 item.fmt = HDF_CENTER | HDF_STRING;
839 for(UINT_PTR index = 0;index < infos->count ;++index){
841 item.pszText = infos->columns[index];
843 item.cxy = infos->holizensize[index];
844 m_header.AddItem(&item);
849 UINT_PTR itemCount = m_header.GetItemCount();
850 for(UINT_PTR u_index = 0;u_index < itemCount;++u_index){
852 m_header.GetItemRect(u_index,&itemRect);
853 nMax += itemRect.right - itemRect.left;
857 this->SetScrollRange(SB_HORZ,0,nMax,TRUE);
863 VOID CCommentView::DecisionHorzSize(){
865 HDWP hWindowPosInfo = BeginDeferWindowPos(2);
867 this->GetClientRect(&bkWindowRect);
868 m_header.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,::GetSystemMetrics(SM_CXFULLSCREEN),commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
869 m_commentListWindow.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,::GetSystemMetrics(SM_CXFULLSCREEN),bkWindowRect.bottom - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
871 EndDeferWindowPos(hWindowPosInfo);
880 //
\83R
\83\81\83\93\83g
\83r
\83\85\81[
\83N
\83\89\83X
\93à
\95\94\83\8a\83X
\83g
\83N
\83\89\83X
881 ////////////////////////////////////////////////////////////////////
883 CCommentListWindow::CCommentListWindow(CCommentView &in_self):
887 CFontHandle font = ::AtlGetDefaultGuiFont();
889 font.GetLogFont(&logfont);
890 logfont.lfUnderline = TRUE;
892 linkFont.CreateFontIndirect(&logfont);
895 CCommentListWindow::~CCommentListWindow(){
900 VOID CCommentListWindow::OnSetProperty(){
902 if(IsWindow() == TRUE)this->SetRedraw(FALSE);
904 if(collLinePen.IsNull() == FALSE)collLinePen.DeleteObject();
905 if(normalSellLinePen.IsNull() == FALSE)normalSellLinePen.DeleteObject();
906 if(normalBkBrush.IsNull() == FALSE)normalBkBrush.DeleteObject();
907 if(selectSellLinePen.IsNull() ==FALSE)selectSellLinePen.DeleteObject();
908 if(selectBkBrush.IsNull() == FALSE)selectBkBrush.DeleteObject();
910 collLinePen.CreatePen(PS_SOLID,1,self.viewproperty.colLineColor);
911 normalSellLinePen.CreatePen(PS_SOLID,1,self.viewproperty.normalSellLineColor);
912 normalBkBrush.CreateSolidBrush(self.viewproperty.backColor);
913 selectSellLinePen.CreatePen(PS_SOLID,1,self.viewproperty.selectSellLineColor);
914 selectBkBrush.CreateSolidBrush(self.viewproperty.selectBackColor);
917 if(IsWindow() == TRUE)this->SetRedraw(TRUE);
921 VOID CCommentListWindow::OnPaint(HDC in_hdc){
923 this->self.refAuth.GetUserSession();
928 self.GetClientRect(&clientRect);
929 clientRect.bottom -= commentViewConstant::HEADER_HAIGHT;
931 this->GetWindowRect(&windowRect);
932 windowRect.right -= windowRect.left;
933 windowRect.bottom -= windowRect.top;
941 CMemoryDC mdc(pdc,windowRect);
942 mdc.SelectFont(AtlGetDefaultGuiFont());
945 CCommentList &commentList = self.commentlist;
947 BOOL selectFlag = FALSE;
948 CCommentList::iterator selectData;
949 RECT selectRect = {0};
953 if(commentList.Size() > 0){
955 listRect = windowRect;
956 listRect.right = self.GetColumnHolSizeSum();
958 CCommentList::iterator chatData = commentList.GetShortCut();
963 mdc.FillRect(&listRect,this->normalBkBrush);
965 CCommentList::iterator endData = commentList.end();
968 RECT headerRects[COMMENTVIEW_HEADERITEMSIZE];
969 RECT colLineRects[COMMENTVIEW_HEADERITEMSIZE];
970 RECT selectHeaderRects[COMMENTVIEW_HEADERITEMSIZE];
972 self.m_header.GetItemRect(CCommentView::NO,&headerRects[CCommentView::NO]);
973 self.m_header.GetItemRect(CCommentView::USERNAME,&headerRects[CCommentView::USERNAME]);
974 self.m_header.GetItemRect(CCommentView::COMMENT,&headerRects[CCommentView::COMMENT]);
975 self.m_header.GetItemRect(CCommentView::TIME,&headerRects[CCommentView::TIME]);
976 self.m_header.GetItemRect(CCommentView::INFO,&headerRects[CCommentView::INFO]);
978 memcpy(colLineRects,headerRects,sizeof(headerRects));
984 headerRects[CCommentView::NO].left += SELL_SPACE_LENGTH;
985 headerRects[CCommentView::USERNAME].left += SELL_SPACE_LENGTH;
986 headerRects[CCommentView::COMMENT].left += SELL_SPACE_LENGTH;
987 headerRects[CCommentView::TIME].left += SELL_SPACE_LENGTH;
988 headerRects[CCommentView::INFO].left += SELL_SPACE_LENGTH;
990 headerRects[CCommentView::NO].right -= SELL_SPACE_LENGTH;
991 headerRects[CCommentView::USERNAME].right -= SELL_SPACE_LENGTH;
992 headerRects[CCommentView::COMMENT].right -= SELL_SPACE_LENGTH;
993 headerRects[CCommentView::TIME].right -= SELL_SPACE_LENGTH;
994 headerRects[CCommentView::INFO].right -= SELL_SPACE_LENGTH;
996 headerRects[CCommentView::NO].top = SELL_SPACE_LENGTH;
997 headerRects[CCommentView::USERNAME].top = SELL_SPACE_LENGTH;
998 headerRects[CCommentView::COMMENT].top = SELL_SPACE_LENGTH;
999 headerRects[CCommentView::TIME].top = SELL_SPACE_LENGTH;
1000 headerRects[CCommentView::INFO].top = SELL_SPACE_LENGTH;
1002 headerRects[CCommentView::NO].bottom = SELL_SPACE_LENGTH;
1003 headerRects[CCommentView::USERNAME].bottom = SELL_SPACE_LENGTH;
1004 headerRects[CCommentView::COMMENT].bottom = SELL_SPACE_LENGTH;
1005 headerRects[CCommentView::TIME].bottom = SELL_SPACE_LENGTH;
1006 headerRects[CCommentView::INFO].bottom = SELL_SPACE_LENGTH;
1008 INT_PTR listRectTop = listRect.top;
1009 for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){
1010 CalcItemHeight(*chatData);
1012 // dumpln(TEXT("height:%d"),chatData->viewData.height);
1013 listRect.bottom += chatData->viewData.height;
1015 headerRects[CCommentView::NO].top = listRect.top + SELL_SPACE_LENGTH;
1016 headerRects[CCommentView::USERNAME].top = listRect.top + SELL_SPACE_LENGTH;
1017 headerRects[CCommentView::COMMENT].top = listRect.top + SELL_SPACE_LENGTH;
1018 headerRects[CCommentView::TIME].top = listRect.top + SELL_SPACE_LENGTH;
1019 headerRects[CCommentView::INFO].top = listRect.top + SELL_SPACE_LENGTH;
1021 headerRects[CCommentView::NO].bottom = listRect.bottom - SELL_SPACE_LENGTH;
1022 headerRects[CCommentView::USERNAME].bottom = listRect.bottom - SELL_SPACE_LENGTH;
1023 headerRects[CCommentView::COMMENT].bottom = listRect.bottom - SELL_SPACE_LENGTH;
1024 headerRects[CCommentView::TIME].bottom = listRect.bottom - SELL_SPACE_LENGTH;
1025 headerRects[CCommentView::INFO].bottom = listRect.bottom - SELL_SPACE_LENGTH;
1027 if(chatData->viewData.selectFlag == TRUE){
1029 selectData = chatData;
1030 selectRect = listRect;
1031 memcpy(selectHeaderRects,headerRects,sizeof(headerRects));
1037 this->DrawItem(mdc,listRect,headerRects,*chatData);
1041 listRect.top = listRect.bottom;
1044 viewSellHeight = listRect.bottom;
1048 if(selectFlag == TRUE){
1049 this->DrawItem(mdc,selectRect,selectHeaderRects,*selectData);
1052 //
\8d\80\96Ú
\82Ì
\8fc
\90ü
\82ð
\95`
\89æ
1053 mdc.SelectPen(collLinePen);
1054 mdc.MoveTo(colLineRects[CCommentView::NO].right,listRectTop);
1055 mdc.LineTo(colLineRects[CCommentView::NO].right,listRect.bottom);
1056 mdc.MoveTo(colLineRects[CCommentView::USERNAME].right,listRectTop);
1057 mdc.LineTo(colLineRects[CCommentView::USERNAME].right,listRect.bottom);
1058 mdc.MoveTo(colLineRects[CCommentView::COMMENT].right,listRectTop);
1059 mdc.LineTo(colLineRects[CCommentView::COMMENT].right,listRect.bottom);
1060 mdc.MoveTo(colLineRects[CCommentView::TIME].right,listRectTop);
1061 mdc.LineTo(colLineRects[CCommentView::TIME].right,listRect.bottom);
1062 mdc.MoveTo(colLineRects[CCommentView::INFO].right,listRectTop);
1063 mdc.LineTo(colLineRects[CCommentView::INFO].right,listRect.bottom);
1066 windowRect.left = listRect.right;
1067 mdc.FillRect(&windowRect,(HBRUSH)::GetStockObject(GRAY_BRUSH));
1081 LRESULT CCommentListWindow::OnSetCtrol(UINT uMsg,WPARAM wparam,LPARAM lparam){
1085 self.chatChildCtrlsList.ShowCntrls();
1092 VOID CCommentListWindow::OnSize(UINT wParam, _WTYPES_NS::CSize &windowSize){
1095 SCROLLINFO vScrollInfo = {0};
1096 vScrollInfo.fMask = SIF_ALL;
1099 self.GetScrollInfo(SB_VERT,&vScrollInfo);
1100 BOOL scrollFlag = (UINT)(vScrollInfo.nPage + vScrollInfo.nPos + 1) >= (UINT)vScrollInfo.nMax;
1101 vScrollInfo.nPage = CalcScrollPage(vScrollInfo.nMax);
1103 vScrollInfo.fMask = SIF_PAGE;
1104 self.SetScrollInfo(SB_VERT,&vScrollInfo);
1108 if(scrollFlag == TRUE){
1109 self.SendMessageW(WM_VSCROLL,MAKELONG(SB_BOTTOM,0),0);
1113 this->SendMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
1119 UINT_PTR CCommentListWindow::CalcScrollPage(UINT_PTR nMax){
1124 this->GetClientRect(&clientRect);
1126 SCROLLINFO vScrollInfo = {0};
1127 if(self.commentlist.empty() != TRUE){
1129 CCommentList::reverse_iterator rbegin = self.commentlist.rbegein();
1130 CCommentList::reverse_iterator rend = self.commentlist.rend();
1131 for(;rbegin != rend;++rbegin){
1132 CalcItemHeight(*rbegin);
1133 height += rbegin->viewData.height;
1135 if(height > clientRect.bottom)goto overclientrect;
1140 vScrollInfo.fMask = SIF_RANGE;
1141 self.GetScrollInfo(SB_VERT,&vScrollInfo);
1151 VOID CCommentListWindow::DrawItem(CDC &dc,const RECT &rc,const RECT *headerRect,CChatData &chatData){
1154 RECT noViewRect = headerRect[CCommentView::NO]; //
\83R
\83\81\94Ô
\95\
\8e¦
\97Ì
\88æ
1155 RECT userNameViewRect = headerRect[CCommentView::USERNAME]; //
\83\86\81[
\83U
\96¼
\95\
\8e¦
\97Ì
\88æ
1156 RECT chatViewRect = headerRect[CCommentView::COMMENT]; //
\83R
\83\81\83\93\83g
\95\
\8e¦
\97Ì
\88æ
1157 RECT timeViewRect = headerRect[CCommentView::TIME]; //
\8e\9e\8aÔ
\95\
\8e¦
\97Ì
\88æ
1158 RECT infoViewRect = headerRect[CCommentView::INFO]; //
\83R
\83\81\83\93\83g
\8fî
\95ñ
\95\
\8e¦
\97Ì
\88æ
1162 //
\83R
\83\81\83\93\83g
\8e\9e\8aÔ
\95\
\8e¦
\97p
\95¶
\8e\9a\97ñ
\8dì
\90¬
1164 time_t chatTime = (time_t)difftime(chatData.date,self.stream.GetStartTime());
1167 BOOL beforeStartFlag = chatTime < 0 ? TRUE : FALSE;
1168 TCHAR noString[sizeof(chatData.no) * 8];
1169 TCHAR dateString[LENGTH_16];
1170 if(chatData.no != 0)_stprintf(noString,TEXT("%u"),chatData.no);
1171 else _tcscpy(noString,TEXT(""));
1172 CNLiteString timeFormat;
1175 if(beforeStartFlag == TRUE){
1177 timeFormat = TEXT("-");
1178 chatTime = -chatTime;
1180 tm ct = *gmtime(&chatTime);
1181 if(ct.tm_hour != 0 ){
1183 timeFormat += TEXT("%H:%M:%S");
1187 timeFormat += TEXT("%M:%S");
1190 _tcsftime(dateString,ARRAY_LENGTH(dateString),timeFormat,&ct);
1193 COLORREF bkColor; //
\94w
\8ci
\90F
1194 CPen originSellLinePen; //
\98g
\90ü
\95`
\89æ
\97p
\83y
\83\93
1195 CBrush originBkBrush; //
\94w
\8ci
\95`
\89æ
\97p
\83u
\83\89\83V
1197 //
\91I
\91ð
\8fó
\91Ô
\82©
\83`
\83F
\83b
\83N
1198 if (chatData.viewData.selectFlag == TRUE)
1200 bkColor = self.viewproperty.selectBackColor;
1202 dc.SelectBrush(this->selectBkBrush);
1203 dc.SelectPen(this->selectSellLinePen);
1208 if(chatData.viewData.sellLineColor == CChatData::ViewData::INIT_COLOR){
1209 dc.SelectPen(this->normalSellLinePen);
1213 originSellLinePen.CreatePen(PS_SOLID,1,chatData.viewData.sellLineColor);
1214 dc.SelectPen(originSellLinePen);
1219 if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR || chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){
1221 if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR){
1222 bkColor = chatData.viewData.backColor;
1223 originBkBrush.CreateSolidBrush(chatData.viewData.backColor);
1225 }else if(chatData.listenerData->bgcolor != ListenerData::INIT_COLOR){
1227 bkColor = chatData.listenerData->bgcolor;
1228 originBkBrush.CreateSolidBrush(chatData.listenerData->bgcolor);
1232 dc.SelectBrush(originBkBrush);
1235 bkColor = self.viewproperty.backColor;
1236 dc.SelectBrush(this->normalBkBrush);
1237 dc.SelectBrush(this->normalBkBrush);
1243 //
\94w
\8ci
\82Æ
\98g
\90ü
\82ð
\95`
\89æ
1246 dc.Rectangle(rc.left,rc.top - 1,rc.right ,rc.bottom + 1);
1247 dc.SetBkColor(bkColor);
1250 //
\95`
\89æ
\83T
\83C
\83Y
\82ð
\8cv
\8eZ
1255 CComBSTR &viewUserName = chatData.listenerData->name.Length() == 0 ? chatData.listenerData->user_id : chatData.listenerData->name;
1256 dc.SelectFont(linkFont);
1257 dc.SetTextColor(chatData.listenerData->nameColor != ListenerData::INIT_COLOR ? chatData.listenerData->nameColor : self.viewproperty.linkStringColor);
1258 //
\83e
\83L
\83X
\83g
\95`
\89æ
1259 dc.DrawTextW(noString,_tcslen(noString),&noViewRect,DT_WORD_ELLIPSIS);
1262 dc.DrawTextW(viewUserName,viewUserName.Length(),&userNameViewRect,DT_WORD_ELLIPSIS);
1263 dc.SelectFont(::AtlGetDefaultGuiFont());
1264 dc.SetTextColor(chatData.viewData.stringColor == CChatData::ViewData::INIT_COLOR ? chatData.viewData.stringColor :self.viewproperty.baseStringColor);
1265 dc.DrawTextW(dateString,_tcslen(dateString),&timeViewRect,DT_WORD_ELLIPSIS);
1270 VOID CCommentListWindow::ResetViewSellHeight(){
1278 VOID CCommentListWindow::ShowCurSel(){
1280 auto end = self.commentlist.end();
1281 INT_PTR cursel = self.commentlist.GetCurSelNo();
1282 if(cursel == -1)goto end;
1284 SCROLLINFO vScrollInfo;
1285 vScrollInfo.cbSize = sizeof(vScrollInfo);
1286 vScrollInfo.fMask = SIF_ALL;
1287 self.GetScrollInfo(SB_VERT,&vScrollInfo);
1289 if(!(cursel >= vScrollInfo.nPos + static_cast<INT_PTR>(vScrollInfo.nPage) / 2 && cursel <= vScrollInfo.nPos + static_cast<INT_PTR>(vScrollInfo.nPage) / 2)){
1290 self.SetScrollPos(SB_VERT,cursel - (vScrollInfo.nPage / 2));
1291 self.commentlist.SetShortCut(self.GetScrollPos(SB_VERT));
1296 this->SendMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
1304 VOID CCommentListWindow::CalcItemHeight(CChatData &chatData){
1306 if(chatData.viewData.height == 0){
1308 self.m_header.GetItemRect(CCommentView::COMMENT,&drowSize);
1310 drowSize.bottom = 0;
1312 CChatReadEdit cedit(self);
1314 cedit.GeneralCreate(*this,ENM_REQUESTRESIZE,CALCEDIT_ID);
1316 cedit.SetWindowPos(NULL,0,0,drowSize.right - drowSize.left,drowSize.bottom - drowSize.top,SWP_NOZORDER | SWP_NOMOVE | SWP_NOREDRAW);
1317 cedit.SetWindowText(chatData);
1318 cedit.GetClientRect(&drowSize);
1319 cedit.DestroyWindow();
1320 drowSize.bottom += 12;
1321 if(drowSize.bottom - drowSize.top > 120)drowSize.bottom = drowSize.top + 120;
1322 chatData.viewData.height = drowSize.bottom - drowSize.top;
1330 LRESULT CCommentListWindow::OnCreate(LPCREATESTRUCT lpCreateStruct){
1332 //CComPtr<IUnknown> iu;
1333 //::AtlAxCreateControlEx(TEXT("MSHTML:<HTML><BODY></BODY></HTML>"),*this,(IStream*)NULL,(IUnknown**)NULL,&iu,GUID_NULL);
1335 //iu->QueryInterface(DIID_DWebBrowserEvents2,&addToMyListWindow);
1336 RECT rc = {0,0,300,200};
1337 // addToMyListWindow.Create(m_hWnd, &rc,_T("Shell.Explorer.2"),WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN , 0);
1342 CCommentList::iterator CCommentListWindow::CalcClickLine(INT_PTR height){
1344 INT_PTR heightSum = 0;
1346 CCommentList::iterator chatData = self.commentlist.GetShortCut();
1347 CCommentList::iterator end = self.commentlist.end();
1351 for(; chatData != end ;(++chatData)){
1352 CalcItemHeight(*chatData);
1353 heightSum += chatData->viewData.height;
1356 if(heightSum >= height)break;
1366 BOOL CCommentListWindow::IsOnNoOrUserName(UINT_PTR index,const POINT &point){
1370 self.m_header.GetItemRect(index,&rc);
1373 if((point.x >= rc.left && point.x <= rc.right) && (point.y < static_cast<INT_PTR>(viewSellHeight))){
1375 INT_PTR heightsum = 0;
1376 auto clickData = self.commentlist.GetShortCut();
1377 auto endData = self.commentlist.end();
1378 for(;clickData != endData;++clickData){
1380 heightsum += clickData->viewData.height;
1382 if(heightsum > point.y){
1384 CDC cdc = this->GetDC();
1386 rc.top = heightsum -= clickData->viewData.height;
1387 RECT calcRect = {0};
1388 cdc.SelectFont(linkFont);
1391 if(index == CCommentView::USERNAME){
1392 LPCTSTR viewStr = clickData->listenerData->name.Length() == 0 ? clickData->listenerData->user_id : clickData->listenerData->name;
1393 cdc.DrawTextW(viewStr ,_tcslen(viewStr),&calcRect,DT_CALCRECT);
1395 } else if(index == CCommentView::NO){
1396 TCHAR viewStr[sizeof(UINT_PTR) * 8];
1397 _stprintf(viewStr,TEXT("%d"),clickData->no);
1398 cdc.DrawTextW(viewStr,_tcslen(viewStr),&calcRect,DT_CALCRECT);
1401 rc.bottom = rc.top + calcRect.bottom - calcRect.top;
1402 rc.right = rc.right > rc.left + calcRect.right - calcRect.left ? rc.left + calcRect.right - calcRect.left : rc.right;
1403 rslt = (point.y >= rc.top && point.y <= rc.bottom && point.x >= rc.left && point.x <= rc.right);
1417 VOID CCommentListWindow::OnDestroy(){
1419 // this->addToMyListWindow.DestroyWindow();
1423 VOID CCommentListWindow::OnLButtonDown(UINT wParam, _WTYPES_NS::CPoint &point){
1427 CCommentList::iterator ite;
1429 if(point.x > (INT_PTR)self.GetColumnHolSizeSum()) goto end;
1432 if(self.commentlist.empty() == TRUE)goto end;
1434 ite = CalcClickLine(point.y);
1435 self.commentlist.SetCurSel(ite);
1437 if(this->IsOnNoOrUserName(CCommentView::NO,point) == TRUE){
1439 ::SendMessage(self,UM_CLICK_CHATNO,(WPARAM)&(*ite),(LPARAM)self.m_hWnd);
1441 } else if(this->IsOnNoOrUserName(CCommentView::USERNAME,point) == TRUE){
1443 ::SendMessage(self,UM_CLICK_USERNAME,(WPARAM)&(*ite),(LPARAM)self.m_hWnd);
1451 this->SendMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
1457 VOID CCommentListWindow::OnLButtonDblClk(UINT wParam, _WTYPES_NS::CPoint &point){
1461 if(!(point.x > (INT_PTR)self.GetColumnHolSizeSum() || self.commentlist.empty() == TRUE)){
1463 auto end = self.commentlist.end();
1464 auto lineIte = CalcClickLine(point.y);
1465 if( lineIte == end)goto endlabel;
1469 if(lineIte->listenerData->bgcolor == ListenerData::INIT_COLOR){
1470 CListenerColorCollector colorCollector;
1471 listenerList.BkColorCollect(colorCollector);
1476 srand((unsigned int)time(NULL));
1482 bkColor = PALETTERGB(red,green,blue);
1484 }while(colorCollector.Find(bkColor));
1487 lineIte->listenerData->SetBkColor(bkColor);
1491 lineIte->listenerData->bgcolor = ListenerData::INIT_COLOR;
1502 this->Invalidate(TRUE);
1504 this->SendMessage(UM_COMMENTVIEW_SETCTRL,NULL,NULL);
1508 LRESULT CCommentListWindow::OnEraseBkGnd(HDC lparam){
1513 VOID CCommentListWindow::OnKeyDown(TCHAR vKey,UINT loLParam,UINT hiLParam){
1536 auto cursel = self.commentlist.GetCurSel();
1537 if((dy < 0 && cursel == self.commentlist.begin()) || dy >= static_cast<INT_PTR>(self.commentlist.Size()))goto end;
1540 std::advance(cursel,dy);
1541 self.commentlist.SetCurSel(cursel);
1550 LRESULT CCommentListWindow::OnSetCursor(HWND wparam,UINT loLparam,UINT hiLparam){
1553 POINT mousePoint = {0};
1555 GetCursorPos(&mousePoint);
1556 ::ScreenToClient(*this,&mousePoint);
1558 if(( IsOnNoOrUserName(CCommentView::NO,mousePoint) || IsOnNoOrUserName(CCommentView::USERNAME,mousePoint))){
1561 ::SetCursor(::LoadCursorW(NULL,IDC_HAND));
1576 LRESULT CCommentListWindow::OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &point){
1579 self.SendMessageW(WM_VSCROLL,MAKELONG(hiWparam < 0 ? SB_PAGEDOWN : SB_PAGEUP ,0),0);
1588 LRESULT CCommentListWindow::OnChatControlNortify(LPNMHDR lParam){
1592 switch(lParam->code){
1596 ENLINK *lpenlk = (ENLINK *)lParam;
1597 if (lpenlk->msg == WM_LBUTTONDOWN) {
1598 CRichEditCtrl chatReadEdit = lpenlk->nmhdr.hwndFrom;
1599 chatReadEdit.SetSel(lpenlk->chrg);
1601 chatReadEdit.GetSelText(selTextBuf);
1602 if(regex_match((LPCTSTR)selTextBuf,nliteregex::URL) == TRUE){
1607 } else if(regex_match((LPCTSTR)selTextBuf,nliteregex::VIDEOID) == TRUE){
1609 selTextBuf.Insert(0,ADDMYLIST_PART);
1611 } else if( regex_match((LPCTSTR)selTextBuf,nliteregex::LIVEID) == TRUE){
1613 selTextBuf.Insert(0,LIVEURL_PART);
1617 OpenURL(*this,self.generalProperty,selTextBuf,SW_SHOWNORMAL);
1624 auto pmf = (MSGFILTER *)lParam;
1625 if (pmf->msg == WM_LBUTTONDOWN || pmf->msg== WM_LBUTTONDBLCLK || pmf->msg == WM_MOUSEWHEEL){
1628 ::GetWindowRect(pmf->nmhdr.hwndFrom,&windowrect);
1629 _WTYPES_NS::CPoint point(windowrect.left + LOWORD(pmf->lParam),windowrect.top + HIWORD(pmf->lParam));
1630 ::ScreenToClient(*this,&point);
1634 case WM_LBUTTONDOWN:
1635 OnLButtonDown(pmf->wParam,point);
1638 case WM_LBUTTONDBLCLK:
1639 OnLButtonDblClk(pmf->wParam,point);
1643 OnMouseWheel(LOWORD(pmf->wParam),HIWORD(pmf->wParam),point);
1670 LRESULT CCommentListWindow::OnCalcSellSize(LPNMHDR lParam){
1672 auto pReqResize = reinterpret_cast <REQRESIZE *>(lParam);
1673 ::SetWindowPos(pReqResize->nmhdr.hwndFrom,NULL,0,0,pReqResize->rc.right - pReqResize->rc.left,pReqResize->rc.bottom - pReqResize->rc.top,SWP_NOZORDER | SWP_NOMOVE | SWP_HIDEWINDOW);