home *** CD-ROM | disk | FTP | other *** search
- #include <stdafx.h>
-
- #include "cslider.h"
-
-
- CSlider::CSlider(HWND hWnd,WORD id,DWORD dwStyles,LPSTR szTitle,int x, int y, int width, int height)
- {
- registerSlider();
-
- m_hWnd=::CreateWindow("slider", szTitle,dwStyles,
- x, y, width, height,
- hWnd, (HMENU)id,
- AfxGetInstanceHandle(), 0L);
- }
-
- CSlider::~CSlider()
- {
- }
-
- WORD CSlider::getPos()
- {
- return (WORD)::SendMessage(m_hWnd,SCM_GETPOS,0,0L);
- }
-
- void CSlider::setPos(WORD wPos)
- {
- ::SendMessage(m_hWnd,SCM_SETPOS,(WPARAM)wPos,0L);
- }
-
- LONG CSlider::getRange()
- {
- return ::SendMessage(m_hWnd,SCM_GETRANGE,0,0L);
- }
-
- void CSlider::setRange(WORD wLow,WORD wHigh)
- {
- ::SendMessage(m_hWnd,SCM_SETRANGE,0,MAKELONG(wLow,wHigh));
- }