GetScrollBarCtrl Win32?
카테고리 없음 / 2016. 9. 2. 23:30
CScrollView에서 GetScrollBarCtrl 을 호출해 봤지만, NULL리턴
CScrollBar *pCScrollBar;
pCScrollBar=((CScrollView*)m_pCScrollView)->GetScrollBarCtrl(SB_HORZ);
win32 API용 GetScrollBarCtrl 함수는 없는듯.(윈도우 자체 내장된 스크롤바는 윈도우가 아닌듯)
CScrollBar* CView::GetScrollBarCtrl(int nBar) const { ASSERT(nBar == SB_HORZ || nBar == SB_VERT); if (GetStyle() & ((nBar == SB_HORZ) ? WS_HSCROLL : WS_VSCROLL)) { // it has a regular windows style scrollbar (no control) return NULL; } CWnd* pParent = GetParentSplitter(this, TRUE); if (pParent == NULL) return NULL; // no splitter UINT nID = _AfxGetDlgCtrlID(m_hWnd); if (nID < AFX_IDW_PANE_FIRST || nID > AFX_IDW_PANE_LAST) return NULL; // not a standard pane ID // appropriate PANE id - look for sibling (splitter, or just frame) UINT nIDScroll; if (nBar == SB_HORZ) nIDScroll = AFX_IDW_HSCROLL_FIRST + (nID - AFX_IDW_PANE_FIRST) % 16; else nIDScroll = AFX_IDW_VSCROLL_FIRST + (nID - AFX_IDW_PANE_FIRST) / 16; // return shared scroll bars that are immediate children of splitter return (CScrollBar*)pParent->GetDlgItem(nIDScroll); } |