From: qwerty2501 Date: Tue, 10 Jan 2012 07:53:13 +0000 (+0900) Subject: 2012/01/10 16:53:13 X-Git-Tag: v0.001~84 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9c396bdd3dc35d21cc3af950ac328a735e8ea999;p=nlite%2Fnlite.git 2012/01/10 16:53:13 --- diff --git a/nlite.suo b/nlite.suo index ee329b0..ef9bbd0 100644 Binary files a/nlite.suo and b/nlite.suo differ diff --git a/nlite/nlite_commentview.cpp b/nlite/nlite_commentview.cpp index eaab104..1be0df7 100644 --- a/nlite/nlite_commentview.cpp +++ b/nlite/nlite_commentview.cpp @@ -213,6 +213,7 @@ VOID CCommentView::OnChatReceve(NicoLiveChat_P chat,UINT_PTR count){ Lock(); + m_listBox.SetRedraw(FALSE); commentlist.OnChatReceve(chat,count); m_listBox.AddString((LPCTSTR)&commentlist.back()); @@ -221,8 +222,9 @@ VOID CCommentView::OnChatReceve(NicoLiveChat_P chat,UINT_PTR count){ m_listBox.GetScrollInfo(SB_VERT,&scrollInfo); scrollInfo.nPos++; + if(scrollInfo.nPos + (int)scrollInfo.nPage >= scrollInfo.nMax == TRUE){ - m_listBox.SendMessageW(WM_VSCROLL,SB_BOTTOM,0); + m_listBox.SendMessageW(WM_VSCROLL,MAKEWORD(SB_BOTTOM,0),0); } Unlock(); } @@ -602,10 +604,12 @@ VOID CCommentView::OnHScroll(INT_PTR loWParam,SHORT hiWParam,HWND lParam){ LRESULT CCommentView::OnCreate(LPCREATESTRUCT lpcs){ 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); - m_listBox.Create(m_hWnd,0,WC_LISTBOX,WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY | LBS_NOREDRAW ,0,commentViewConstant::LISTBOX_ID); + m_listBox.Create(m_hWnd,0,WC_LISTBOX,WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY | LBS_NOREDRAW , 0,commentViewConstant::LISTBOX_ID); m_listBox.SetFont(AtlGetDefaultGuiFont()); - - + /* + m_subListBox.SubclassWindow(m_listBox); + m_subListBox.CreateMemoryDC(); + */ return 0; } @@ -663,3 +667,26 @@ VOID CCommentView::DecisionHorzSize(){ //ƒRƒƒ“ƒgƒrƒ…[ƒNƒ‰ƒX“à•”ƒŠƒXƒgƒNƒ‰ƒX //////////////////////////////////////////////////////////////////// + +VOID CCommentView::CSubCommentListBox::OnPaint(HDC hdc){ + + PAINTSTRUCT ps; + this->BeginPaint(&ps); + + + this->EndPaint(&ps); + + return; +} + + + +VOID CCommentView::CSubCommentListBox::CreateMemoryDC(){ + HDC hdc = this->GetDC(); + m_MemoryDC.CreateCompatibleDC(hdc); + m_Bitmap.CreateCompatibleBitmap(m_MemoryDC,300,200); + + ReleaseDC(hdc); + return; +} + \ No newline at end of file diff --git a/nlite/nlite_commentview.h b/nlite/nlite_commentview.h index 4645391..9f78e9f 100644 --- a/nlite/nlite_commentview.h +++ b/nlite/nlite_commentview.h @@ -29,6 +29,32 @@ namespace nlite{ }HEADERSINFO,*LPHEADERSINFO; + + + class CSubCommentListBox:public CDoubleBufferWindowImpl{ + + //ƒvƒ‰ƒCƒx[ƒgƒƒ“ƒo + private: + CDC m_MemoryDC; + CBitmap m_Bitmap; + LPDWORD lpPixel; + + public: + + + BEGIN_MSG_MAP_EX(CSubCommentListBox) + MSG_WM_PAINT(OnPaint) + CHAIN_MSG_MAP(CDoubleBufferWindowImpl) + END_MSG_MAP() + + VOID CreateMemoryDC(); + + private: + VOID OnPaint(HDC hdc); + + + + }; //ƒƒ“ƒoéŒ¾ private: @@ -46,7 +72,7 @@ namespace nlite{ CPen colLinePen; HFONT hHeaderFontNew; SCROLLINFO hScrollInfo; - +// CSubCommentListBox m_subListBox;