本文整理汇总了C++中GetScrollInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetScrollInfo函数的具体用法?C++ GetScrollInfo怎么用?C++ GetScrollInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetScrollInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:xydrawbox.cpp
示例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,代码来源:native_scroll_bar_win.cpp
示例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,代码来源:ktrashskipctrl.cpp
示例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,代码来源:TerrainEditorDlg.cpp
示例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,代码来源:DisplayDlg.cpp
示例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,代码来源:GoodPlayer.cpp
示例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,代码来源:area_windows.c
示例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,代码来源:sys_win.c
示例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,代码来源:GraphListCtrl.cpp
示例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,代码来源:DemoFunctions.cpp
示例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,代码来源:ED6AIViewer.cpp
示例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,代码来源:areascroll.cpp
示例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,代码来源:BContainer.cpp
示例14: scroller
static int
scroller( 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,代码来源:memorybrowser.c
示例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,代码来源:WindowUtils.cpp
示例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,代码来源:WndMapPartsGrp.cpp
示例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,代码来源:ConsoleWindow.cpp
示例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,代码来源:ExecutionLogWindow.cpp
示例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,代码来源:HTRichEditCtrl.cpp
示例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,代码来源:ui_win.c
注:本文中的GetScrollInfo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论