2 #include "nlite_include.h"
8 //
\83R
\83\81\83\93\83g
\83r
\83\85\81[
\83N
\83\89\83X
\83\81\83\
\83b
\83h
9 ///////////////////////////////////////////////////////
11 CCommentView::CCommentView():
12 m_commentListWindow(*this)
17 lf.lfCharSet = SHIFTJIS_CHARSET;
20 hHeaderFontNew = CreateFontIndirect(&lf);
27 CCommentView::~CCommentView(){
30 DeleteObject(hHeaderFontNew);
38 VOID CCommentView::OnConnect(){
39 m_commentListWindow.SetRedraw(FALSE);
40 commentlist.OnConnect();
42 SCROLLINFO vScrollInfo = {0};
43 vScrollInfo.cbSize = sizeof(vScrollInfo);
44 vScrollInfo.fMask = SIF_RANGE;
47 this->SetScrollPos(SB_VERT,0,FALSE);
49 m_commentListWindow.SetRedraw(TRUE);
55 UINT_PTR CCommentView::GetColumnHolSizeSum(){
59 this->GetScrollRange(SB_HORZ,&nMin,&nMax);
64 VOID CCommentView::SetProperty(CommentViewProperty &setProperty){
66 viewproperty = setProperty;
70 CommentViewProperty &CCommentView::GetProperty(){
80 HWND CCommentView::Create(HWND hWndParent){
84 HWND rslt = __super::Create(hWndParent,0,commentViewConstant::NLITE_COMMENTVIEW,WS_VISIBLE | WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_BORDER,0,commentViewConstant::MENU_OR_ID);
87 HDC hdc = m_header.BeginPaint(&ps);
90 HFONT hOld = (HFONT)SelectObject(hdc,hHeaderFontNew);
92 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ñ")};
93 UINT_PTR holizenSize[] = {0,0,100,0,0};
95 for(UINT_PTR index = 0;index < ARRAY_LENGTH(columns) ;++index){
97 GetTextExtentPoint32(hdc , columns[index] , _tcslen(columns[index]) , &size);
98 UINT_PTR holsize = holizenSize[index] + size.cx + 15;
99 holizenSize[index] = viewproperty.headerholSize[index] >= 0 ? viewproperty.headerholSize[index] : holsize;
102 SelectObject(hdc,hOld);
104 m_header.EndPaint(&ps);
107 HEADERSINFO headersinfo = {columns,holizenSize,ARRAY_LENGTH(columns)};
109 AddHeader(&headersinfo);
111 m_header.SetOrderArray(ARRAY_LENGTH(viewproperty.headerOraderArray),viewproperty.headerOraderArray);
122 LRESULT CCommentView::OnHeaderEndTrack(LPNMHDR lParam){
125 if(lParam->hwndFrom == m_header.m_hWnd){
128 m_commentListWindow.SetRedraw(FALSE);
129 SCROLLINFO vScrollInfo = {0};
130 vScrollInfo.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
132 this->GetScrollInfo(SB_VERT,&vScrollInfo);
133 vScrollInfo.nPage = m_commentListWindow.CalcScrollPage(vScrollInfo.nMax);
134 vScrollInfo.fMask = SIF_PAGE;
135 this->SetScrollInfo(SB_VERT,&vScrollInfo);
137 BOOL scrollFlag = vScrollInfo.nPos + (int)vScrollInfo.nPage + 1>= vScrollInfo.nMax;
138 UINT_PTR commentCount = commentlist.Size();
139 LPNMHEADER lpNmHdr = (LPNMHEADER )lParam;
141 m_header.SetItem(lpNmHdr->iItem,lpNmHdr->pitem);
149 if(scrollFlag == TRUE){
151 this->SendMessageW(WM_VSCROLL,MAKELONG(SB_BOTTOM,0),0);
154 INT_PTR itemCount = m_header.GetItemCount();
158 for(INT_PTR itemIndex = 0;itemIndex < itemCount;itemIndex++){
159 m_header.GetItemRect(itemIndex,&itemSizeRect);
160 nMax += itemSizeRect.right - itemSizeRect.left;
164 this->SetScrollRange(SB_HORZ,nMin,nMax,TRUE);
168 auto begin = commentlist.begin();
170 auto end = commentlist.end();
173 for(;begin != end;++begin){
175 begin->height = m_commentListWindow.CalcItemHeight(*begin);
178 m_commentListWindow.SetRedraw(TRUE);
179 if(TryEnterCriticalSection(&m_commentListWindow.m_sec) == TRUE){
180 m_commentListWindow.Invalidate();
181 m_commentListWindow.Unlock();
189 VOID CCommentView::OnChatReceve(NicoLiveChat_P chat,UINT_PTR commnetCountSum){
191 commentlist.OnChatReceve(chat,commnetCountSum,this->m_commentListWindow);
197 VOID CCommentView::SetStreamStatus(StreamStatus &st){
199 streamStatus.SetStreamStatus(st);
202 VOID CCommentView::OnChatReceveSettle(UINT_PTR chatNo,UINT_PTR commentCountSum){
205 SCROLLINFO vScrollInfo = {0};
209 vScrollInfo.fMask = SIF_ALL;
211 this->GetScrollInfo(SB_VERT,&vScrollInfo);
212 BOOL scrollFlag = vScrollInfo.nPos + (int)vScrollInfo.nPage >= vScrollInfo.nMax;
216 // vScrollInfo.fMask = SIF_RANGE;
217 vScrollInfo.cbSize = sizeof(vScrollInfo);
219 vScrollInfo.nMax = commentCountSum;
220 // this->SetScrollRange(SB_VERT,vScrollInfo.nMin,vScrollInfo.nMax,FALSE);
221 // this->SetScrollInfo(SB_VERT,&vScrollInfo,FALSE);
222 vScrollInfo.fMask = SIF_RANGE | SIF_PAGE;
223 vScrollInfo.nPage = m_commentListWindow.CalcScrollPage(vScrollInfo.nMax);
226 this->SetScrollInfo(SB_VERT,&vScrollInfo,FALSE);
231 if(scrollFlag == TRUE){
232 this->SendMessageW(WM_VSCROLL,MAKEWORD(SB_BOTTOM,0),0);
236 if(vScrollInfo.nPos + static_cast<INT_PTR>(vScrollInfo.nPage) >= vScrollInfo.nMax - static_cast<INT_PTR>(vScrollInfo.nPage)&& TryEnterCriticalSection(&m_commentListWindow.m_sec) == TRUE){
237 m_commentListWindow.Invalidate();
238 m_commentListWindow.Unlock();
242 //this->SetScrollInfo(SB_VERT,NULL);
247 static UCHAR getrgb(){
249 UCHAR rgb = 160 + rand() % 92;
263 LRESULT CCommentView::OnSize(UINT wParam,SIZE lParam){
270 VOID CCommentView::ChangeSize(const SIZE& client){
272 SCROLLINFO hScrollInfo = {0};
273 hScrollInfo.cbSize = sizeof(hScrollInfo);
274 hScrollInfo.fMask = SIF_PAGE;
275 hScrollInfo.nPage = client.cx;
277 this->SetScrollInfo(SB_HORZ,&hScrollInfo);
278 hScrollInfo.fMask = SIF_ALL;
279 this->GetScrollInfo(SB_HORZ,&hScrollInfo);
282 HDWP hDwp = BeginDeferWindowPos(2);
285 INT_PTR movePos = -1 * hScrollInfo.nPos;
287 m_header.DeferWindowPos(hDwp,m_header.m_hWnd,movePos,0,0,0,SWP_NOSIZE | SWP_NOZORDER);
288 m_commentListWindow.DeferWindowPos(hDwp,m_commentListWindow.m_hWnd,movePos,commentViewConstant::HEADER_HAIGHT,::GetSystemMetrics(SM_CXFULLSCREEN),client.cy - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER);
290 EndDeferWindowPos(hDwp);
295 m_header.GetWindowRect(&headerRectSize);
296 bkRect.left = headerRectSize.right - headerRectSize.left - hScrollInfo.nPos;
298 bkRect.right = client.cx ;
299 bkRect.bottom = client.cy;
306 LRESULT CCommentView::OnEraseBkgnd(HDC wParam){
312 VOID CCommentView::OnDestroy(){
313 m_header.GetOrderArray(ARRAY_LENGTH(viewproperty.headerOraderArray),viewproperty.headerOraderArray);
314 INT_PTR headerItemcount = m_header.GetItemCount();
316 for(INT_PTR itemindex = 0;itemindex < headerItemcount;itemindex++){
318 m_header.GetItemRect(itemindex,&headerItemRect);
319 viewproperty.headerholSize[itemindex] = headerItemRect.right - headerItemRect.left;
321 commentlist.OnDestroy();
322 m_header.DestroyWindow();
323 m_commentListWindow.DestroyWindow();
328 LRESULT CCommentView::OnHeaderEndDrag(LPNMHDR lParam){
330 if(lParam->hwndFrom == m_header.m_hWnd){
331 if(TryEnterCriticalSection(&m_commentListWindow.m_sec) == TRUE){
333 m_commentListWindow.Invalidate();
334 m_commentListWindow.Unlock();
343 VOID CCommentView::OnHScroll(INT_PTR loWParam,SHORT hiWParam,HWND lParam){
347 SCROLLINFO hScrollInfo = {0};
348 hScrollInfo.cbSize = sizeof(hScrollInfo);
349 hScrollInfo.fMask = SIF_ALL;
350 this->GetScrollInfo(SB_HORZ,&hScrollInfo);
353 case SB_THUMBPOSITION:
355 dy = hiWParam - hScrollInfo.nPos;
361 dy = -1 * hScrollInfo.nPage;
368 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;
378 dy = max(-1 * hScrollInfo.nPos, min(dy, hScrollInfo.nMax - hScrollInfo.nPos));
382 hScrollInfo.nPos += dy;
383 INT_PTR moveRange = -(hScrollInfo.nPos);
385 HDWP hDwp = BeginDeferWindowPos(2);
387 m_header.DeferWindowPos(hDwp,m_header.m_hWnd,moveRange,0,0,0,SWP_NOSIZE | SWP_NOZORDER);
388 m_commentListWindow.DeferWindowPos(hDwp,m_commentListWindow.m_hWnd,moveRange,commentViewConstant::HEADER_HAIGHT,0,0,SWP_NOSIZE | SWP_NOZORDER);
390 EndDeferWindowPos(hDwp);
393 this->SetScrollInfo(SB_HORZ,&hScrollInfo);
400 VOID CCommentView::OnVScroll(INT_PTR loWParam,SHORT hiWParam,HWND lParam){
403 SCROLLINFO vScrollInfo = {0};
404 vScrollInfo.fMask = SIF_ALL;
407 this->GetScrollInfo(SB_VERT,&vScrollInfo);
412 case SB_THUMBPOSITION:
415 dy = hiWParam - vScrollInfo.nPos;
432 dy = -1 * vScrollInfo.nPage;
438 dy = vScrollInfo.nPage;
445 dy = -vScrollInfo.nPos;
451 dy = vScrollInfo.nMax;
468 vScrollInfo.nPos += dy;
469 // viewStartHeight = vScrollInfo.nPos;
470 this->SetScrollPos(SB_VERT,vScrollInfo.nPos);
471 //this->SetScrollInfo(SB_VERT,&vScrollInfo);
472 this->UpdateWindow();
473 if(TryEnterCriticalSection(&m_commentListWindow.m_sec) == TRUE){
474 m_commentListWindow.Invalidate();
475 m_commentListWindow.Unlock();
484 LRESULT CCommentView::OnCreate(LPCREATESTRUCT lpcs){
485 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);
486 m_commentListWindow.Create(m_hWnd,0,commentViewConstant::NLITE_COMMENTLISTWINDOW,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN , 0,commentViewConstant::LISTBOX_ID);
494 VOID CCommentView::AddHeader(LPHEADERSINFO infos){
497 m_header.SetFont(hHeaderFontNew);
500 item.mask = HDI_FORMAT | HDI_TEXT | HDI_WIDTH;
501 item.fmt = HDF_CENTER | HDF_STRING;
504 for(UINT_PTR index = 0;index < infos->count ;++index){
506 item.pszText = infos->columns[index];
508 item.cxy = infos->holizensize[index];
509 m_header.AddItem(&item);
514 UINT_PTR itemCount = m_header.GetItemCount();
515 for(UINT_PTR u_index = 0;u_index < itemCount;++u_index){
517 m_header.GetItemRect(u_index,&itemRect);
518 nMax += itemRect.right - itemRect.left;
522 this->SetScrollRange(SB_HORZ,0,nMax,TRUE);
528 VOID CCommentView::DecisionHorzSize(){
530 HDWP hWindowPosInfo = BeginDeferWindowPos(2);
532 this->GetClientRect(&bkWindowRect);
533 m_header.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,::GetSystemMetrics(SM_CXFULLSCREEN),commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
534 m_commentListWindow.DeferWindowPos(hWindowPosInfo,m_header.m_hWnd,0,0,::GetSystemMetrics(SM_CXFULLSCREEN),bkWindowRect.bottom - commentViewConstant::HEADER_HAIGHT,SWP_NOZORDER | SWP_NOMOVE);
536 EndDeferWindowPos(hWindowPosInfo);
545 //
\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
546 ////////////////////////////////////////////////////////////////////
548 CCommentListWindow::CCommentListWindow(CCommentView &in_self):
552 CCommentListWindow::~CCommentListWindow(){
556 VOID CCommentListWindow::OnPaint(HDC in_hdc){
564 self.GetClientRect(&clientRect);
565 clientRect.bottom -= commentViewConstant::HEADER_HAIGHT;
567 this->GetWindowRect(&windowRect);
568 windowRect.right -= windowRect.left;
569 windowRect.bottom -= windowRect.top;
572 RECT listRect = windowRect;
573 listRect.right = self.GetColumnHolSizeSum();
577 CMemoryDC mdc(pdc,windowRect);
578 mdc.SelectFont(AtlGetDefaultGuiFont());
579 mdc.FillRect(&clientRect,(HBRUSH)::GetStockObject(GRAY_BRUSH));
581 CCommentList &commentList = self.commentlist;
583 BOOL selectFlag = FALSE;
584 CCommentList::iterator selectData;
585 RECT selectRect = {0};
586 UINT_PTR viewStartHeight = self.GetScrollPos(SB_VERT);
589 if(commentList.Size() > (UINT_PTR)viewStartHeight){
593 CCommentList::iterator chatData = commentList.begin();
594 std::advance(chatData,viewStartHeight);
599 baseBkBrush.CreateSolidBrush(self.viewproperty.backColor);
600 mdc.FillRect(&listRect,baseBkBrush);
601 baseBkBrush.DeleteObject();
602 CCommentList::iterator endData = commentList.end();
606 outLinePen.CreatePen(PS_SOLID,1,ColorList::outLineNomal);
607 mdc.SelectPen(outLinePen);
608 mdc.MoveTo(listRect.right,listRect.top);
609 mdc.LineTo(listRect.right,listRect.bottom);
612 for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){
613 listRect.bottom += CalcItemHeight(*chatData);
616 if(chatData->selectFlag == TRUE){
618 selectData = chatData;
619 selectRect = listRect;
622 this->DrawItem(mdc,listRect,*chatData);
626 listRect.top = listRect.bottom;
629 mdc.SelectPen(outLinePen);
630 mdc.MoveTo(listRect.left,listRect.bottom);
631 mdc.LineTo(listRect.right,listRect.bottom);
633 if(selectFlag == TRUE){
634 this->DrawItem(mdc,selectRect,*selectData);
650 VOID CCommentListWindow::OnSize(UINT wParam, _WTYPES_NS::CSize &windowSize){
653 SCROLLINFO vScrollInfo = {0};
654 vScrollInfo.fMask = SIF_ALL;
657 self.GetScrollInfo(SB_VERT,&vScrollInfo);
658 BOOL scrollFlag = (UINT)(vScrollInfo.nPage + vScrollInfo.nPos + 1) >= (UINT)vScrollInfo.nMax;
659 vScrollInfo.nPage = CalcScrollPage(vScrollInfo.nMax);
661 vScrollInfo.fMask = SIF_PAGE;
662 self.SetScrollInfo(SB_VERT,&vScrollInfo);
666 if(scrollFlag == TRUE){
667 self.SendMessageW(WM_VSCROLL,MAKELONG(SB_BOTTOM,0),0);
676 UINT_PTR CCommentListWindow::CalcScrollPage(UINT_PTR nMax){
681 this->GetClientRect(&clientRect);
683 SCROLLINFO vScrollInfo = {0};
684 if(self.commentlist.empty() != TRUE){
686 CCommentList::reverse_iterator rbegin = self.commentlist.rbegein();
687 CCommentList::reverse_iterator rend = self.commentlist.rend();
688 for(;rbegin != rend;++rbegin){
690 height += CalcItemHeight(*rbegin);
692 if(height > clientRect.bottom)goto overclientrect;
697 vScrollInfo.fMask = SIF_RANGE;
698 self.GetScrollInfo(SB_VERT,&vScrollInfo);
708 VOID CCommentListWindow::DrawItem(CDC &dc,RECT &rc,CChatData &chatData){
712 RECT userNameViewRect;
718 time_t chatTime = (time_t)difftime(chatData.date,self.streamStatus.start_time);
721 BOOL beforeStartFlag = chatTime < 0 ? TRUE : FALSE;
722 TCHAR noString[sizeof(chatData.no) * 8];
723 TCHAR dateString[LENGTH_16];
724 _stprintf(noString,TEXT("%u"),chatData.no);
726 CNLiteString timeFormat;
729 if(beforeStartFlag == TRUE){
731 timeFormat = TEXT("-");
732 chatTime = -chatTime;
734 tm ct = *gmtime(&chatTime);
735 if(ct.tm_hour != 0 ){
737 timeFormat += TEXT("%H:%M:%S");
741 timeFormat += TEXT("%M:%S");
744 _tcsftime(dateString,ARRAY_LENGTH(dateString),timeFormat,&ct);
747 COLORREF outLineColor;
752 colLinePen.CreatePen(PS_SOLID,1,ColorList::colLine);
755 //
\91I
\91ð
\8fó
\91Ô
\82©
\83`
\83F
\83b
\83N
756 if (chatData.selectFlag == TRUE)
758 bkColor = ColorList::selectBack;
759 outLineColor = ColorList::outLineSelect;
766 outLineColor = ColorList::outLineNomal;
768 if(chatData.listenerData->originBkFlag == TRUE){
770 bkColor = chatData.listenerData->bkColor;
775 bkColor = self.viewproperty.backColor;
782 outLinePen.CreatePen(PS_SOLID,1,outLineColor);
783 bkBrush.CreateSolidBrush(bkColor);
784 dc.SelectPen(outLinePen);
786 if(chatData.selectFlag == TRUE){
788 dc.MoveTo(rc.left,rc.bottom);
789 dc.LineTo(rc.right,rc.bottom);
791 dc.FillRect(&rc,bkBrush);
792 dc.SetBkColor(bkColor);
793 dc.MoveTo(rc.left,rc.top);
794 dc.LineTo(rc.right,rc.top);
798 dc.SetTextColor(self.viewproperty.baseStringColor);
804 //
\95`
\89æ
\83T
\83C
\83Y
\82ð
\8cv
\8eZ
806 self.m_header.GetItemRect(CCommentView::NO,&noViewRect);
807 self.m_header.GetItemRect(CCommentView::USERNAME,&userNameViewRect);
808 self.m_header.GetItemRect(CCommentView::COMMENT,&chatViewRect);
809 self.m_header.GetItemRect(CCommentView::TIME,&timeViewRect);
810 self.m_header.GetItemRect(CCommentView::INFO,&infoViewRect);
812 noViewRect.left += 2;
813 userNameViewRect.left += 2;
814 timeViewRect.left += 2;
815 chatViewRect.left += 2;
816 infoViewRect.left += 2;
818 noViewRect.right -= 2;
819 userNameViewRect.right -= 2;
820 timeViewRect.right -= 2;
821 chatViewRect.right -= 2;
822 infoViewRect.right -= 2;
824 noViewRect.top = rc.top + 2;
825 userNameViewRect.top = rc.top + 2;
826 timeViewRect.top = rc.top + 2;
827 chatViewRect.top = rc.top + 2;
828 infoViewRect.top = rc.top + 2;
830 noViewRect.bottom = rc.bottom - 2;
831 userNameViewRect.bottom = rc.bottom - 2;
832 timeViewRect.bottom = rc.bottom - 2;
833 chatViewRect.bottom = rc.bottom - 2;
834 infoViewRect.bottom = rc.bottom - 2;
836 dc.SelectPen(colLinePen);
838 dc.MoveTo(noViewRect.right,rc.top);
839 dc.LineTo(noViewRect.right,rc.bottom);
840 dc.MoveTo(userNameViewRect.right,rc.top);
841 dc.LineTo(userNameViewRect.right,rc.bottom);
842 dc.MoveTo(chatViewRect.right,rc.top);
843 dc.LineTo(chatViewRect.right,rc.bottom);
844 dc.MoveTo(timeViewRect.right,rc.top);
845 dc.LineTo(timeViewRect.right,rc.bottom);
847 dc.DrawTextW(noString,_tcslen(noString),&noViewRect,DT_WORD_ELLIPSIS);
848 dc.DrawTextW(chatData.listenerData->user_id,chatData.listenerData->user_id.GetLength(),&userNameViewRect,DT_WORD_ELLIPSIS);
849 dc.DrawTextW(chatData.chatBuf,chatData.chatBuf.GetLength(),&chatViewRect,DT_WORDBREAK);
850 dc.DrawTextW(dateString,_tcslen(dateString),&timeViewRect,DT_WORD_ELLIPSIS);
856 UINT_PTR CCommentListWindow::CalcItemHeight(CChatData &chatData){
859 self.m_header.GetItemRect(CCommentView::COMMENT,&drowSize);
866 pdc.SelectFont(AtlGetDefaultGuiFont());
867 ::DrawTextW(pdc,chatData.chatBuf,chatData.chatBuf.GetLength(),&drowSize, DT_CALCRECT | DT_WORDBREAK);
869 drowSize.bottom += 2;
871 return drowSize.bottom;
875 LRESULT CCommentListWindow::OnCreate(LPCREATESTRUCT lpCreateStruct){
880 INT_PTR CCommentListWindow::CalcClickLine(INT_PTR height){
881 SCROLLINFO vScrollInfo = {0};
882 vScrollInfo.fMask = SIF_POS;
884 self.GetScrollInfo(SB_VERT,&vScrollInfo);
886 INT_PTR heightSum = 0;
887 INT_PTR lineNo = vScrollInfo.nPos;
888 CCommentList::iterator chatData = self.commentlist.begin();
889 CCommentList::iterator end = self.commentlist.end();
890 std::advance(chatData,vScrollInfo.nPos);
891 for(; chatData != end;++chatData){
893 heightSum += CalcItemHeight(*chatData);
895 if(heightSum >= height){
911 VOID CCommentListWindow::OnLButtonDown(UINT wParam, _WTYPES_NS::CPoint &point){
916 if(self.commentlist.empty() == TRUE)return;
917 auto curselItem = self.commentlist.GetCurSelItem();
918 if(curselItem != self.commentlist.end()){
919 curselItem->selectFlag = FALSE;
921 self.commentlist.SetCurSel(CalcClickLine(point.y));
922 if(TryEnterCriticalSection(&this->m_sec) == TRUE){
930 VOID CCommentListWindow::OnLButtonDbClk(UINT wParam, _WTYPES_NS::CPoint &point){
936 if(self.commentlist.empty() == TRUE)return;
938 auto chatData = self.commentlist.GetChatAt(CalcClickLine(point.y));
940 if(chatData.listenerData->originBkFlag == FALSE){
941 CListenerColorCollector colorCollector;
942 listenerList.BkColorCollect(colorCollector);
947 srand((unsigned int)time(NULL));
953 bkColor = RGB(red,green,blue);
955 }while(colorCollector.Find(bkColor));
957 chatData.listenerData->originBkFlag = TRUE;
958 chatData.listenerData->SetBkColor(bkColor);
962 chatData.listenerData->originBkFlag = FALSE;
970 if(TryEnterCriticalSection(&this->m_sec) == TRUE){
971 this->Invalidate(TRUE);
981 LRESULT CCommentListWindow::OnEraseBkGnd(HDC lparam){
986 LRESULT CCommentListWindow::OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &point){
989 self.SendMessageW(WM_VSCROLL,MAKELONG(hiWparam < 0 ? SB_PAGEDOWN : SB_PAGEUP ,0),0);