| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2013 人关注过本帖
标题:[求助]scrollwindow函数有什么作用?
只看楼主 加入收藏
thao888
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-4-24
收藏
 问题点数:0 回复次数:5 
[求助]scrollwindow函数有什么作用?

在学习windows编程时遇到scrollwindow函数,看不太明白,请问:该函数有什么作用?具体怎样使用?最好能举一个实例。谢了!

搜索更多相关主题的帖子: scrollwindow 函数 
2007-06-27 10:59
I喜欢c
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:64
帖 子:1749
专家分:0
注 册:2007-3-2
收藏
得分:0 
ScrollWindow是旧版本兼容函数。现在用ScrollWindowEx

int ScrollWindowEx(
HWND hWnd, // 窗口句柄
int dx, // 水平方向的滚动量
int dy, // 垂直方向的滚动量
CONST RECT *prcScroll, // 客户区域
CONST RECT *prcClip, // Clip
HRGN hrgnUpdate, // 更新区域句柄
LPRECT prcUpdate, // 无效区
UINT flags // 滚动方法: SW_ERASE
SW_INVALIDATE
SW_SCROLLCHILDREN
SW_SMOOTHSCROLL

);

例(摘自msdn的Samples\sdk\graphics\icm20\icmview):
ScrollWindow( hWnd, 0, -10, NULL, NULL,NULL, NULL, SW_INVALIDATE);

 我是指针,却丢失了目标地址!          我是循环,却缺少了结束条件!      我是函数,却没有人来调用!   
2007-06-27 12:26
百年不亮
Rank: 3Rank: 3
等 级:新手上路
威 望:8
帖 子:789
专家分:0
注 册:2006-4-14
收藏
得分:0 

The ScrollWindow function scrolls the contents of the specified window's client area.

Note The ScrollWindow function is provided for backward compatibility. New applications should use the ScrollWindowEx function.

Syntax

BOOL ScrollWindow(      
HWND hWnd,
int XAmount,
int YAmount,
const RECT *lpRect,
const RECT *lpClipRect
);

Parameters

hWnd
[in] Handle to the window where the client area is to be scrolled.
XAmount
[in] Specifies the amount, in device units, of horizontal scrolling. If the window being scrolled has the CS_OWNDC or CS_CLASSDC style, then this parameter uses logical units rather than device units. This parameter must be a negative value to scroll the content of the window to the left.
YAmount
[in] Specifies the amount, in device units, of vertical scrolling. If the window being scrolled has the CS_OWNDC or CS_CLASSDC style, then this parameter uses logical units rather than device units. This parameter must be a negative value to scroll the content of the window up.
lpRect
[in] Pointer to the RECT structure specifying the portion of the client area to be scrolled. If this parameter is NULL, the entire client area is scrolled.
lpClipRect
[in] Pointer to the RECT structure containing the coordinates of the clipping rectangle. Only device bits within the clipping rectangle are affected. Bits scrolled from the outside of the rectangle to the inside are painted; bits scrolled from the inside of the rectangle to the outside are not painted.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


Remarks

If the caret is in the window being scrolled, ScrollWindow automatically hides the caret to prevent it from being erased and then restores the caret after the scrolling is finished. The caret position is adjusted accordingly.

The area uncovered by ScrollWindow is not repainted, but it is combined into the window's update region. The application eventually receives a WM_PAINT message notifying it that the region must be repainted. To repaint the uncovered area at the same time the scrolling is in action, call the UpdateWindow function immediately after calling ScrollWindow.

If the lpRect parameter is NULL, the positions of any child windows in the window are offset by the amount specified by the XAmount and YAmount parameters; invalid (unpainted) areas in the window are also offset. ScrollWindow is faster when lpRect is NULL.

If lpRect is not NULL, the positions of child windows are not changed and invalid areas in the window are not offset. To prevent updating problems when lpRect is not NULL, call UpdateWindow to repaint the window before calling ScrollWindow.

2007-06-27 12:28
killer_l
Rank: 2
等 级:新手上路
威 望:3
帖 子:1139
专家分:0
注 册:2007-5-25
收藏
得分:0 

2007-06-27 12:50
死了都要C
Rank: 4
来 自:四川成都
等 级:贵宾
威 望:13
帖 子:1582
专家分:116
注 册:2006-12-7
收藏
得分:0 
我和LS一起流汗```

女施主``我给你``送茶来了```师太``你就从了老衲吧``
代码本天成~~~妙头偶得之```
2007-06-27 14:27
lishizelibin
Rank: 2
等 级:论坛游民
帖 子:513
专家分:41
注 册:2007-5-10
收藏
得分:0 

惟有学习不断的学习!
2007-06-27 16:38
快速回复:[求助]scrollwindow函数有什么作用?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016018 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved