请教win32前辈: 如何对Slider(进度条)编程?

ucConke 2005-08-25 02:06:59
我指的是全部用win32 API而不是MFC写的application
我不知道消息部分该怎么写,一时也找不到资料
...全文
265 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
Seu_why 2005-08-26
晕~
关注
回复
i_noname 2005-08-25
"请教win32前辈: 如何对Slider(进度条)编程?"
--------------------------------------------
SliderBar是滑动条,进度条是ProgressBar,你问的是哪个呢?
如果是SliderBar的话,那我就没错,如果是ProgressBar,那你当我没说过...
回复
i_noname 2005-08-25
没错,sdk下没有sliderbar,是用scrollbar来完成相同任务的。
回复
ucConke 2005-08-25
莫非Slider其实是Scroll的一种?
回复
ucConke 2005-08-25
谢谢,不过我问是SliderBar不是ScrollBar :)
回复
i_noname 2005-08-25
LRESULT CALLBACK ScrollProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) ;
UING msg == WM_VSCROLL
nScrollCode = (int) LOWORD(wParam); // scroll bar value
nPos = (short int) HIWORD(wParam); // scroll box position
hwndScrollBar = (HWND) lParam; // handle to scroll bar

nScrollCode
Value of the low-order word of wParam. Specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values: Value Meaning
SB_BOTTOM Scrolls to the lower right.
SB_ENDSCROLL Ends scroll.
SB_LINEDOWN Scrolls one line down.
SB_LINEUP Scrolls one line up.
SB_PAGEDOWN Scrolls one page down.
SB_PAGEUP Scrolls one page up.
SB_THUMBPOSITION The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation.
SB_THUMBTRACK The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The nPos parameter indicates the position that the scroll box has been dragged to.
SB_TOP Scrolls to the upper left.

nPos
Value of the high-order word of wParam. Specifies the current position of the scroll box if the nScrollCode parameter is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, nPos is not used.

hwndScrollBar
Value of lParam. If the message is sent by a scroll bar, then hwndScrollBar is the handle to the scroll bar control. If the message is not sent by a scroll bar, hwndScrollBar is NULL.

回复
ucConke 2005-08-25
消息处理callback函数中的后面两个参数(WPARAM wParam, LPARAM lParam )分别怎么用?
INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
回复
发帖
界面
创建于2007-09-28

1.5w+

社区成员

VC/MFC 界面
申请成为版主
帖子事件
创建了帖子
2005-08-25 02:06
社区公告
暂无公告