您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetScrollInfo函数代码示例

51自学网 2021-06-01 21:14:41
  C++
这篇教程C++ GetScrollInfo函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetScrollInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetScrollInfo函数的具体用法?C++ GetScrollInfo怎么用?C++ GetScrollInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetScrollInfo函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SetScrollInfo

void XYDrawbox::RefreshYPosScrollBar(){	scrollinfo.fMask = SIF_POS;	scrollinfo.nPos = this->posYScroll;	SetScrollInfo(this->hwndThis, SB_VERT, &scrollinfo, TRUE);	GetScrollInfo(this->hwndThis, SB_VERT, &scrollinfo);	this->posYScroll = scrollinfo.nPos;}
开发者ID:adamadanandy,项目名称:XYDiaCap,代码行数:8,


示例2: sizeof

 int NativeScrollBarWin::GetPosition() const {     SCROLLINFO si;     si.cbSize = sizeof(si);     si.fMask = SIF_POS;     GetScrollInfo(sb_container_->GetScrollBarHWND(), SB_CTL, &si);     return si.nPos; }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:8,


示例3: GetScrollInfo

LRESULT CTrashSkipCtrl::OnVScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){    SCROLLINFO si;    int vertPos;    si.cbSize = sizeof si;    si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE | SIF_TRACKPOS;    GetScrollInfo(SB_VERT, &si);    vertPos = si.nPos;    switch (LOWORD(wParam))    {    case SB_TOP:        si.nPos = si.nMin;        break;    case SB_BOTTOM:        si.nPos = si.nMax;        break;    case SB_LINEUP:        si.nPos -= 1;        break;    case SB_LINEDOWN:        si.nPos += 1;        break;    case SB_PAGEUP:        si.nPos -= si.nPage;        break;    case SB_PAGEDOWN:        si.nPos += si.nPage;        break;    case SB_THUMBTRACK:        si.nPos = si.nTrackPos;        break;    default:        break;    }    si.fMask = SIF_ALL;    m_nPos = abs(si.nPos);    SetScrollInfo(SB_VERT, &si, TRUE);    int nScrollHeight = int((m_rcRealClient.Height() - m_rcClient.Height()) * (m_nPos * 1.0) / (m_rcRealClient.Height()));    int n = (m_nHeight - nScrollHeight);    if (n > 1 || n < -1)    {        Invalidate();    }    bHandled = FALSE;    return TRUE;}
开发者ID:6520874,项目名称:pcmanager,代码行数:58,


示例4: GetScrollInfo

void CTerrainEditorDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar){	SCROLLINFO si;	si.cbSize=sizeof(si);	GetScrollInfo(SB_HORZ,&si);	int pos;	switch(nSBCode)	{	case SB_LEFT:		ScrollWindow(si.nPos-si.nMin,0);		si.nPos=si.nMin;		SetScrollInfo(SB_HORZ,&si);		break;	case SB_RIGHT:		ScrollWindow(si.nPos-si.nMax+si.nPage,0);		si.nPos=si.nMax-si.nPage;		SetScrollInfo(SB_HORZ,&si);		break;	case SB_LINELEFT:		pos=si.nPos;		si.nPos-=10;		if(si.nPos<si.nMin) si.nPos=si.nMin;		ScrollWindow(pos-si.nPos,0);		SetScrollInfo(SB_HORZ,&si);		break;	case SB_LINERIGHT:		pos=si.nPos;		si.nPos+=si.nPage;		if(si.nPos>si.nMax-(int)si.nPage) si.nPos=si.nMax-si.nPage;		ScrollWindow(pos-si.nPos,0);		SetScrollInfo(SB_HORZ,&si);		break;	case SB_PAGELEFT:		pos=si.nPos;		si.nPos-=si.nPage;		if(si.nPos<si.nMin) si.nPos=si.nMin;		ScrollWindow(pos-si.nPos,0);		SetScrollInfo(SB_HORZ,&si);		break;	case SB_PAGERIGHT:		pos=si.nPos;		si.nPos+=10;		if(si.nPos>si.nMax-(int)si.nPage) si.nPos=si.nMax-si.nPage;		ScrollWindow(pos-si.nPos,0);		SetScrollInfo(SB_HORZ,&si);		break;	case SB_THUMBPOSITION:	case SB_THUMBTRACK:		ScrollWindow(si.nPos-nPos,0);		si.nPos=nPos;		SetScrollInfo(SB_HORZ,&si);		break;	default:		break;	}	CDialogEx::OnHScroll(nSBCode, nPos, pScrollBar);}
开发者ID:phoenixzz,项目名称:SGPEngine,代码行数:58,


示例5: sizeof

void CDisplayDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar){    int h = 10;    SCROLLINFO si;    si.cbSize = sizeof(SCROLLINFO);    si.fMask = SIF_ALL;    GetScrollInfo(SB_VERT, &si);    int nOldPos = si.nPos;    switch (nSBCode)    {    case SB_LINEDOWN:        si.nPos = min(si.nPos + h, si.nMax);        break;    case SB_PAGEDOWN:        si.nPos = min(si.nPos + h * 10, si.nMax);        break;    case SB_LINEUP:        si.nPos = max(si.nPos - h, si.nMin);        break;    case SB_PAGEUP:        si.nPos = max(si.nPos - h * 10, si.nMin);        break;    case SB_THUMBPOSITION:    case SB_THUMBTRACK:        si.nPos = si.nTrackPos;        break;    case SB_TOP:        si.nPos = si.nMin;        break;    case SB_BOTTOM:        si.nPos = si.nMax;        break;    }    SetScrollInfo(SB_VERT, &si);    GetScrollInfo(SB_VERT, &si); //重新获取新的位置    ScrollWindowEx(0, nOldPos - si.nPos,NULL, NULL, NULL, NULL, SW_ERASE|SW_SCROLLCHILDREN);    UpdateWindow();    RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0);    //m_ScreenDisplayer->ReflashDC();    CDialog::OnVScroll(nSBCode, nPos, pScrollBar);}
开发者ID:luis-wang,项目名称:RemoteControlSystem,代码行数:45,


示例6: GetScrollPos

int GetScrollPos(HWND hwnd, int nBar){	SCROLLINFO info;	info.cbSize = sizeof(SCROLLINFO);	info.fMask = SIF_POS;	GetScrollInfo(g_sbTime, SB_CTL, &info);	return info.nPos;}
开发者ID:vincent0629,项目名称:GoodMedia,代码行数:9,


示例7: getScrollPos

static void getScrollPos(HWND hwnd, int *xpos, int *ypos){	SCROLLINFO si;	ZeroMemory(&si, sizeof (SCROLLINFO));	si.cbSize = sizeof (SCROLLINFO);	si.fMask = SIF_POS | SIF_TRACKPOS;	if (GetScrollInfo(hwnd, SB_HORZ, &si) == 0)		xpanic("error getting horizontal scroll position for Area", GetLastError());	*xpos = si.nPos;	// MSDN example code reinitializes this each time, so we'll do it too just to be safe	ZeroMemory(&si, sizeof (SCROLLINFO));	si.cbSize = sizeof (SCROLLINFO);	si.fMask = SIF_POS | SIF_TRACKPOS;	if (GetScrollInfo(hwnd, SB_VERT, &si) == 0)		xpanic("error getting vertical scroll position for Area", GetLastError());	*ypos = si.nPos;}
开发者ID:AlexSteele,项目名称:ui,代码行数:18,


示例8: sys_winlog_set

void sys_winlog_set( void *wnd, const char *txt ) {	HWND text = (HWND)GetProp(wnd,PTEXT);	DWORD a,b;	SCROLLINFO sinf;	POINT pt;	sinf.cbSize = sizeof(sinf);	sinf.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;	GetScrollInfo(text,SB_VERT,&sinf);	SendMessage(text,EM_GETSCROLLPOS,0,(LPARAM)&pt);	SendMessage(text,EM_GETSEL,(WPARAM)&a,(LPARAM)&b);	SetWindowText(text,txt);	SendMessage(text,EM_SETSEL,a,b);	if( sinf.nPos + sinf.nPage == sinf.nMax || sinf.nMax == 1 ) {		GetScrollInfo(text,SB_VERT,&sinf);		pt.y = sinf.nMax - sinf.nPage;	}	SendMessage(text,EM_SETSCROLLPOS,0,(LPARAM)&pt);}
开发者ID:exaphaser,项目名称:neko_static,代码行数:18,


示例9: sizeof

int CGraphListCtrl::GetScrollPos32(int nBar, BOOL bGetTrackPos /* = FALSE */){	SCROLLINFO si;	si.cbSize = sizeof(SCROLLINFO);	if (bGetTrackPos)	{		if (GetScrollInfo(nBar, &si, SIF_TRACKPOS))			return si.nTrackPos;	}	else	{		if (GetScrollInfo(nBar, &si, SIF_POS))			return si.nPos;	}	return 0;}
开发者ID:kanbang,项目名称:SVN,代码行数:18,


示例10: PrintText

void PrintText( HWND hwnd,int cxChar,int cyChar,int cxCaps ){	HDC hdc;	PAINTSTRUCT ps;	SCROLLINFO si;	int iVertPos,iHorzPos,iPaintBeg,iPaintEnd;	int x,y;	TCHAR szBuffer[10];	hdc = BeginPaint(hwnd,&ps);	si.cbSize = sizeof(si);	si.fMask = SIF_POS;	GetScrollInfo(hwnd,SB_VERT,&si);	iVertPos = si.nPos;	GetScrollInfo(hwnd,SB_HORZ,&si);	iHorzPos = si.nPos;	iPaintBeg = max(0,iVertPos + ps.rcPaint.top / cyChar);	iPaintEnd = min(NUMLINES - 1, iVertPos + ps.rcPaint.bottom / cyChar);	for (int i = iPaintBeg ; i <= iPaintEnd ; i++)	{		x = cxChar * (1 - iHorzPos) ;		y = cyChar * (i - iVertPos) ;		TextOut (hdc, x, y,sysmetrics[i].szLabel,			lstrlen (sysmetrics[i].szLabel)) ;		TextOut (hdc, x + 22 * cxCaps, y,sysmetrics[i].szDesc,			lstrlen (sysmetrics[i].szDesc)) ;		SetTextAlign (hdc, TA_RIGHT | TA_TOP) ;		TextOut (hdc, x + 22 * cxCaps + 40 * cxChar, y, szBuffer,			wsprintf (szBuffer, TEXT ("%5d"),			GetSystemMetrics (sysmetrics[i].iIndex))) ;		SetTextAlign (hdc, TA_LEFT | TA_TOP) ;	}	EndPaint(hwnd,&ps);}
开发者ID:yuechuanbingzhi163,项目名称:CPPPractice,代码行数:44,


示例11: sizeof

LRESULT CWindow::OnVScroll(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){    SCROLLINFO si;    si.cbSize = sizeof(si);    si.fMask  = SIF_ALL;    GetScrollInfo(hWnd, SB_VERT, &si);    switch (LOWORD(wParam))    {    case SB_THUMBTRACK:    case SB_THUMBPOSITION:        si.nPos = HIWORD(wParam);        break;    case SB_PAGEDOWN:        si.nPos += si.nPage;        break;    case SB_PAGEUP:        si.nPos -= si.nPage;        break;    case SB_LINEUP:        --si.nPos;        break;    case SB_LINEDOWN:        ++si.nPos;        break;    }    si.fMask = SIF_POS;    SetScrollInfo(hWnd, SB_VERT, &si, True);    GetScrollInfo(hWnd, SB_VERT, &si);    if (iVScrollPos != si.nPos)    {        ScrollWindow(hWnd, 0, cyChar * (iVScrollPos - si.nPos), NULL, NULL);        iVScrollPos = si.nPos;        UpdateWindow(hWnd);    }    return ERROR_SUCCESS;}
开发者ID:Emiyasviel,项目名称:Arianrhod,代码行数:44,


示例12: scroll

static void scroll(uiArea *a, int which, struct scrollParams *p, WPARAM wParam, LPARAM lParam){	int pos;	SCROLLINFO si;	pos = *(p->pos);	switch (LOWORD(wParam)) {	case SB_LEFT:			// also SB_TOP		pos = 0;		break;	case SB_RIGHT:		// also SB_BOTTOM		pos = p->length - p->pagesize;		break;	case SB_LINELEFT:		// also SB_LINEUP		pos--;		break;	case SB_LINERIGHT:		// also SB_LINEDOWN		pos++;		break;	case SB_PAGELEFT:		// also SB_PAGEUP		pos -= p->pagesize;		break;	case SB_PAGERIGHT:	// also SB_PAGEDOWN		pos += p->pagesize;		break;	case SB_THUMBPOSITION:		ZeroMemory(&si, sizeof (SCROLLINFO));		si.cbSize = sizeof (SCROLLINFO);		si.fMask = SIF_POS;		if (GetScrollInfo(a->hwnd, which, &si) == 0)			logLastError(L"error getting thumb position for area");		pos = si.nPos;		break;	case SB_THUMBTRACK:		ZeroMemory(&si, sizeof (SCROLLINFO));		si.cbSize = sizeof (SCROLLINFO);		si.fMask = SIF_TRACKPOS;		if (GetScrollInfo(a->hwnd, which, &si) == 0)			logLastError(L"error getting thumb track position for area");		pos = si.nTrackPos;		break;	}	scrollto(a, which, p, pos);}
开发者ID:Alcaro,项目名称:RetroArch,代码行数:44,


示例13: GetScrollInfo

void BContainer::OnVScroll(UINT nSBCode,UINT nPos, CScrollBar* pScrollBar){	// Handle vertical scrollbar messages	// These can be tweaked to better fit the implementation	int nInc;	int yPos;	SCROLLINFO si;	GetScrollInfo(SB_VERT,&si,SIF_POS | SIF_RANGE | SIF_PAGE);	yPos = si.nPos;	nInc = 0;	switch (nSBCode)	{	case SB_TOP: nInc = -si.nPos; break;	case SB_BOTTOM: nInc = si.nMax-si.nPos; break;	case SB_LINEUP: 		if(si.nPos > 0)			nInc = -1; 		else 			nInc = 0;		break;	case SB_LINEDOWN:		if(si.nPage+si.nPos < si.nMax+1)			nInc = 1; 		else			nInc = 0;		break;//	case SB_PAGEUP: nInc = min(-1, -m_nVertInc); break;//	case SB_PAGEDOWN: nInc = max(1, m_nVertInc); break;	case SB_THUMBTRACK: nInc = nPos - si.nPos; break;	default: nInc = 0;	}//	nInc = max(-si.nPos, min(nInc, si.nMax - si.nPos));	if (nInc)	{		si.nPos += nInc;		int iMove = (yPos - si.nPos)*(ELEMENT_HEIGHT+ELEMENT_SIZE_BETWEEN);		si.cbSize = sizeof(SCROLLINFO);		si.fMask = SIF_POS ;		SetScrollInfo(SB_VERT,&si,true);		ScrollWindow(0, iMove, NULL, NULL);	//	CWnd::UpdateWindow();		//SetScrollPos(SB_VERT, m_nVscrollPos, TRUE);			}			CWnd::OnVScroll(nSBCode, nPos, pScrollBar);}
开发者ID:berendeanicolae,项目名称:gml,代码行数:56,


示例14: scroller

static intscroller( HWND hwndDlg, WPARAM scroll_command ){  libspectrum_word base;  SCROLLINFO si;  si.cbSize = sizeof(si);   si.fMask = SIF_POS;   GetScrollInfo( GetDlgItem( hwndDlg, IDC_MEM_SB ), SB_CTL, &si );  int value = si.nPos;    /* in Windows we have to read the command and scroll the scrollbar manually */  switch( LOWORD( scroll_command ) ) {    case SB_BOTTOM:      value = memorysb_max;      break;    case SB_TOP:      value = memorysb_min;      break;    case SB_LINEDOWN:      value += memorysb_step;      break;    case SB_LINEUP:      value -= memorysb_step;      break;    case SB_PAGEUP:      value -= memorysb_page_inc;      break;    case SB_PAGEDOWN:      value += memorysb_page_inc;      break;    case SB_THUMBPOSITION:    case SB_THUMBTRACK:      value = HIWORD( scroll_command );      break;    default:      return 1;  }  if( value > memorysb_max ) value = memorysb_max;  if( value < memorysb_min ) value = memorysb_min;  /* Drop the low bits before displaying anything */  base = value; base &= 0xfff0;  /* set the new scrollbar position */  memset( &si, 0, sizeof(si) );  si.cbSize = sizeof(si);   si.fMask = SIF_POS;   si.nPos = base;  SetScrollInfo( GetDlgItem( hwndDlg, IDC_MEM_SB ), SB_CTL, &si, TRUE );    update_display( hwndDlg, base );    return 0;}
开发者ID:CiaranG,项目名称:ZXdroid,代码行数:56,


示例15: GetScrollInfo

AutoScroller::~AutoScroller(){    if(scrollInfo_.fMask == 0)    {        scrollInfo_.fMask = SIF_ALL;        BOOL res = GetScrollInfo(window_->GetHWND(), winSB(orient_), &scrollInfo_);        if(!res)            return;    }    bool autoScroll = scrollInfo_.nPos + static_cast<int>(scrollInfo_.nPage) >= scrollInfo_.nMax;    if(autoScroll)    {        memset(&scrollInfo_, 0, sizeof(scrollInfo_));        scrollInfo_.cbSize = sizeof(scrollInfo_);        scrollInfo_.fMask = SIF_ALL;        BOOST_VERIFY(GetScrollInfo(window_->GetHWND(), winSB(orient_), &scrollInfo_));        window_->ScrollLines(scrollInfo_.nMax);    }}
开发者ID:go4and,项目名称:lib,代码行数:19,


示例16: GetScrollInfo

int CWndMapPartsGrp::OnCreate(LPCREATESTRUCT lpCreateStruct){	SCROLLINFO stScrollInfo;	if (CWnd::OnCreate(lpCreateStruct) == -1) {		return -1;	}	GetScrollInfo (SB_HORZ, &stScrollInfo);	stScrollInfo.nPage = 1;	SetScrollInfo (SB_HORZ, &stScrollInfo);	GetScrollInfo (SB_VERT, &stScrollInfo);	stScrollInfo.nPage = 1;	SetScrollInfo (SB_VERT, &stScrollInfo);	MakeImage (m_nMode);	return 0;}
开发者ID:psgsgpsg,项目名称:scrapbookonline,代码行数:19,


示例17: sizeof

void CConsoleWindow::HandleScrollEvent(UINT aMessage, WPARAM aWParam)	{	int scrollDir = (aMessage == WM_HSCROLL) ? SB_HORZ : SB_VERT;	SCROLLINFO scrollInfo;	scrollInfo.cbSize = sizeof(scrollInfo);	scrollInfo.fMask = SIF_ALL;	GetScrollInfo(Handle(), scrollDir, &scrollInfo);	int pos = scrollInfo.nPos;	switch (LOWORD(aWParam))		{		case SB_LINEUP:		// Also SB_LINELEFT.			scrollInfo.nPos -= (aMessage == WM_HSCROLL) ? iView->CharWidth() : iView->CharHeight();			break;		case SB_LINEDOWN:	// Also SB_LINERIGHT.			scrollInfo.nPos += (aMessage == WM_HSCROLL) ? iView->CharWidth() : iView->CharHeight();			break;		case SB_PAGEUP:		// Also SB_PAGELEFT.			scrollInfo.nPos -= scrollInfo.nPage;			break;		case SB_PAGEDOWN:	// Also SB_PAGERIGHT.			scrollInfo.nPos += scrollInfo.nPage;			break;		case SB_THUMBTRACK: 			scrollInfo.nPos = scrollInfo.nTrackPos;			break;		default:			break;		}	scrollInfo.fMask = SIF_POS;	SetScrollInfo (Handle(), scrollDir, &scrollInfo, TRUE);	GetScrollInfo (Handle(), scrollDir, &scrollInfo);	if (scrollInfo.nPos != pos)		{		if (aMessage == WM_HSCROLL)			{			iView->SetHorzScrollPosition(scrollInfo.nPos);			}		else			{			iView->SetVertScrollPosition(scrollInfo.nPos);			}		}	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:43,


示例18: sizeof

UINT ExecutionLogWindow::GetTrackPos(HWND hwnd, int fnBar){    SCROLLINFO si;    si.cbSize = sizeof(si);    si.fMask = SIF_TRACKPOS;    if (GetScrollInfo(hwnd, fnBar, &si)) {        return si.nTrackPos;    }    return 0;}
开发者ID:sengelha,项目名称:deeznes,代码行数:10,


示例19: _tcslen

void CHTRichEditCtrl::AddLine(LPCTSTR pszMsg, int iLen, bool bLink, COLORREF cr, COLORREF bk, DWORD mask){	int iMsgLen = (iLen == -1) ? _tcslen(pszMsg) : iLen;	if (iMsgLen == 0)		return;	// Get Edit contents dimensions and cursor position	long lStartChar, lEndChar;	GetSel(lStartChar, lEndChar);	int iSize = GetWindowTextLength();	// Get Auto-AutoScroll state depending on scrollbar position	bool bAutoAutoScroll = m_bAutoScroll;	// Use the 'ScrollInfo' only, if there is a scrollbar available, otherwise we would	// use a scrollinfo which points to the top and we would thus stay at the top.	bool bScrollInfo = false;	SCROLLINFO si;	si.cbSize = sizeof si;	si.fMask = SIF_ALL;	if ((GetStyle() & WS_VSCROLL) && GetScrollInfo(SB_VERT, &si)) {		bScrollInfo = true;		// use some threshold to determine if at end or "very near" at end, unfortunately		// this is needed to get around richedit specific stuff. this threshold (pixels)		// should somewhat reflect the font size used in the control.		bAutoAutoScroll = (si.nPos >= (int)(si.nMax - si.nPage - 20));	}	// Reduce flicker by ignoring WM_PAINT	m_bNoPaint = true;	BOOL bIsVisible = IsWindowVisible();	if (bIsVisible)		SetRedraw(FALSE);	// Remember where we are	//int iFirstLine = !bAutoAutoScroll ? GetFirstVisibleLine() : 0;	POINT ptScrollPos;	SendMessage(EM_GETSCROLLPOS, 0, (LPARAM)&ptScrollPos);		// Select at the end of text and replace the selection	SafeAddLine(iSize, pszMsg, iMsgLen, lStartChar, lEndChar, bLink, cr, bk, mask);	SetSel(lStartChar, lEndChar); // Restore previous selection	if (bAutoAutoScroll)		ScrollToLastLine();	else {		//LineScroll(iFirstLine - GetFirstVisibleLine());		SendMessage(EM_SETSCROLLPOS, 0, (LPARAM)&ptScrollPos);	}	m_bNoPaint = false;	if (bIsVisible) {		SetRedraw();		Invalidate();	}}
开发者ID:rusingineer,项目名称:eMule-mephisto-mod,代码行数:55,


示例20: HL_NAME

HL_PRIM void HL_NAME(ui_winlog_set_text)( wref *w, const uchar *txt, bool autoScroll ) {	HWND text = (HWND)GetProp(w->h,PTEXT);	DWORD a,b;	SCROLLINFO sinf;	POINT pt;	sinf.cbSize = sizeof(sinf);	sinf.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;	GetScrollInfo(text,SB_VERT,&sinf);	SendMessage(text,EM_GETSCROLLPOS,0,(LPARAM)&pt);	SendMessage(text,EM_GETSEL,(WPARAM)&a,(LPARAM)&b);	SetWindowText(text,txt);	SendMessage(text,EM_SETSEL,a,b);	if( autoScroll ) {		if( sinf.nPos + sinf.nPage == sinf.nMax || sinf.nMax == 1 ) {			GetScrollInfo(text,SB_VERT,&sinf);			pt.y = sinf.nMax - sinf.nPage;		}		SendMessage(text,EM_SETSCROLLPOS,0,(LPARAM)&pt);	}}
开发者ID:HaxeFoundation,项目名称:hl,代码行数:20,


示例21: GetDocument

void CWFView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) {	CBTEditDoc* pDoc = GetDocument();	int	MinPos,MaxPos;	SCROLLINFO ScrollInfo;	CPoint ScrollPos = GetScrollPosition();	m_ScrollX = ScrollPos.x;	m_ScrollY = ScrollPos.y;//	pDoc->GetScrollPosition((SLONG*)&m_ScrollX,(SLONG*)&m_ScrollY);	GetScrollInfo( SB_HORZ, &ScrollInfo, SIF_ALL );	MinPos = ScrollInfo.nMin;	MaxPos = ScrollInfo.nMax-ScrollInfo.nPage;	switch(nSBCode) {		case	SB_THUMBPOSITION:		case	SB_THUMBTRACK:			m_ScrollX = nPos;			break;		case	SB_LINELEFT:			m_ScrollX -= pDoc->GetTextureWidth();			if(m_ScrollX < MinPos) m_ScrollX = MinPos;			break;		case	SB_LINERIGHT:			m_ScrollX += pDoc->GetTextureWidth();			if(m_ScrollX > MaxPos) m_ScrollX = MaxPos;			break;		case	SB_PAGELEFT:			m_ScrollX -= ScrollInfo.nPage;			if(m_ScrollX < MinPos) m_ScrollX = MinPos;			break;		case	SB_PAGERIGHT:			m_ScrollX += ScrollInfo.nPage;			if(m_ScrollX > MaxPos) m_ScrollX = MaxPos;			break;	}	m_ScrollX /= pDoc->GetTextureWidth();	m_ScrollX *= pDoc->GetTextureWidth();	pDoc->RegisterScrollPosition(m_ScrollX-pDoc->GetTextureWidth()*OVERSCAN,m_ScrollY-pDoc->GetTextureHeight()*OVERSCAN);  	UpdateAndValidate();	if(pDoc->Get2DMode() == M2D_WORLD) {		if(pDoc->GetAutoSync()) {			pDoc->Set3DViewPos();	// Bind views.  			pDoc->Invalidate3D();		}	}	SetScrollPos( SB_HORZ, m_ScrollX, TRUE );}
开发者ID:cybersphinx,项目名称:wzgraphicsmods,代码行数:54,


示例22: GetScrollInfo

BOOL CDComView::OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll){    SCROLLINFO info;    if (HIBYTE(nScrollCode) == SB_THUMBTRACK)    {        GetScrollInfo(SB_VERT, &info);        nPos = info.nTrackPos;        Invalidate();    }    return CScrollView::OnScroll(nScrollCode, nPos, bDoScroll);}
开发者ID:cdesjardins,项目名称:DCom,代码行数:11,


示例23: GetClientRect

/** * @param bIgnoreScrollPos - pass true to disregard any existing scrollbar styles. */void CImageView::ResizeImageView(BOOL bIgnoreScrollPos){	SCROLLINFO sinfo;	RECT rcClient;	GetClientRect(m_hwnd, &rcClient);	ZeroMemory(&sinfo, sizeof(sinfo));	sinfo.cbSize = sizeof(sinfo);	if (! bIgnoreScrollPos)	{		sinfo.fMask = SIF_POS;		GetScrollInfo(m_hwnd, SB_HORZ, &sinfo);	}	else		sinfo.nPos = 0;	sinfo.fMask = SIF_POS | SIF_PAGE | SIF_RANGE;	sinfo.nMin = 0;	sinfo.nMax = m_szAjustedBitmapSize.cx > 0 ? m_szAjustedBitmapSize.cx - 1 : 0;	sinfo.nPage = rcClient.right;	ValidateScrollInfo(&sinfo);	SetScrollInfo(m_hwnd, SB_HORZ, &sinfo, TRUE);	GetClientRect(m_hwnd, &rcClient);	ZeroMemory(&sinfo, sizeof(sinfo));	sinfo.cbSize = sizeof(sinfo);	if (! bIgnoreScrollPos)	{		sinfo.fMask = SIF_POS;		GetScrollInfo(m_hwnd, SB_VERT, &sinfo);	}	else		sinfo.nPos = 0;	sinfo.fMask = SIF_POS | SIF_PAGE | SIF_RANGE;	sinfo.nMin = 0;	sinfo.nMax = m_szAjustedBitmapSize.cy > 0 ? m_szAjustedBitmapSize.cy - 1 : 0;	sinfo.nPage = rcClient.bottom;	ValidateScrollInfo(&sinfo);	SetScrollInfo(m_hwnd, SB_VERT, &sinfo, TRUE);	InvalidateRect(m_hwnd, NULL, FALSE);}
开发者ID:ivan386,项目名称:Shareaza,代码行数:44,


示例24: GetScrollInfo

void CScreenDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar){	// TODO: 在此添加消息处理程序代码和/或调用默认值    if (nSBCode != SB_ENDSCROLL)	{		SCROLLINFO hStructure;		GetScrollInfo(SB_HORZ, &hStructure);		hStructure.nPos = nPos;		SetScrollInfo(SB_HORZ, &hStructure);	}	CDialog::OnHScroll(nSBCode, nPos, pScrollBar);}
开发者ID:blackye,项目名称:remote_control,代码行数:12,


示例25: win_scroll_window

void win_scroll_window(HWND window, WPARAM wparam, int scroll_bar, int scroll_delta_line){	SCROLLINFO si;	int scroll_pos;	// retrieve vital info about the scroll bar	memset(&si, 0, sizeof(si));	si.cbSize = sizeof(si);	si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;	GetScrollInfo(window, scroll_bar, &si);	scroll_pos = si.nPos;	// change scroll_pos in accordance with this message	switch(LOWORD(wparam)) 	{		case SB_BOTTOM:			scroll_pos = si.nMax;			break;		case SB_LINEDOWN:			scroll_pos += scroll_delta_line;			break;		case SB_LINEUP:			scroll_pos -= scroll_delta_line;			break;		case SB_PAGEDOWN:			scroll_pos += scroll_delta_line;			break;		case SB_PAGEUP:			scroll_pos -= scroll_delta_line;			break;		case SB_THUMBPOSITION:		case SB_THUMBTRACK:			scroll_pos = HIWORD(wparam);			break;		case SB_TOP:			scroll_pos = si.nMin;			break;	}	// max out the scroll bar value	if (scroll_pos < si.nMin)		scroll_pos = si.nMin;	else if (scroll_pos > (si.nMax - si.nPage))		scroll_pos = (si.nMax - si.nPage);	// if the value changed, set the scroll position	if (scroll_pos != si.nPos)	{		SetScrollPos(window, scroll_bar, scroll_pos, TRUE);		ScrollWindow(window, 0, si.nPos - scroll_pos, NULL, NULL);	}}
开发者ID:Synapseware,项目名称:coco,代码行数:53,


示例26: sizeof

int CImageWnd::GetScrollPos(int nBar){   SCROLLINFO scrollInfo = { 0 };   scrollInfo.cbSize = sizeof(SCROLLINFO);   scrollInfo.fMask = SIF_POS;   // Get current position   GetScrollInfo(nBar, &scrollInfo);   return scrollInfo.nPos;}
开发者ID:sunlong0724,项目名称:myworkspce,代码行数:12,


示例27: HaveScrollBar

//---------------------------------------------------------------------------bool HaveScrollBar(HWND hwnd){  SCROLLINFO si;  si.cbSize = sizeof(si);  si.fMask = SIF_ALL;  BOOL bHaveScrollBar = GetScrollInfo(hwnd, SB_VERT, &si);  if( ! bHaveScrollBar )    return false;  if( si.nMax == 0 || si.nMax == 100 )    return false;  return true;}
开发者ID:MaxBelkov,项目名称:visualsyslog,代码行数:13,


示例28: PreExpandItem

void EXWaitingTreeCtrl::PopulateRoot(){	PreExpandItem(TVI_ROOT);	ExpandItem(TVI_ROOT);	// force update, don't scroll	SetRedraw(FALSE);	SCROLLINFO si;	GetScrollInfo(SB_HORZ, &si);	EnsureVisible(GetChildItem(TVI_ROOT));	SetScrollInfo(SB_HORZ, &si, FALSE);	SetRedraw();}
开发者ID:sosoayaen,项目名称:DescentBoardGameTools,代码行数:12,


示例29: GetScrollInfo

BOOL CTrashCleanCtrl::SetSelectedItem(UINT nItemID){    BOOL bRet = FALSE;    size_t iCount, jCount;    SCROLLINFO si;    int nItemHeiht = 0;    if (nItemID < 0)        goto Clear0;    for (iCount = 0; iCount < m_vecTrashItems.size(); ++iCount)    {        if (!m_vecTrashItems[iCount].bShow)        {            continue;        }        for (jCount = 0; jCount < m_vecTrashItems[iCount].vecItems.size(); ++jCount)        {            if (nItemID == m_vecTrashItems[iCount].vecItems[jCount].nItemId)            {                m_nSelectedIndex = m_vecTrashItems[iCount].vecItems[jCount].nItemId;                m_vecTrashItems[iCount].bShowDetail = TRUE;                nItemHeiht = m_vecTrashItems[iCount].vecItems[jCount].rcCheck.top;                if (nItemHeiht == 0)                    nItemHeiht = m_vecTrashItems[iCount].rcBox.bottom;                bRet = TRUE;                break;            }        }        if (bRet) break;    }        if (bRet)    {        si.cbSize = sizeof si;        si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE | SIF_TRACKPOS;        GetScrollInfo(SB_VERT, &si);        si.fMask = SIF_POS;        m_nPos = (nItemHeiht - (int)si.nPage / 4);        if (m_nPos < 0)            m_nPos = 0;        si.nPos = m_nPos;        SetScrollInfo(SB_VERT, &si, TRUE);    }Clear0:    return bRet;}
开发者ID:6520874,项目名称:pcmanager,代码行数:53,



注:本文中的GetScrollInfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetScrollPosition函数代码示例
C++ GetScriptId函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。