Easy Win 32
Scroll Bar Class –
cEasyScrollBar
cEasyScrollBar Public Members:
HWND scrollbar;
cEasyScrollBar Functions:
Functions to modify and/or setup the ScrollBar (HWND
scrollbar):
int ChangeScrollBarInstance(HINSTANCE)
int ChangeScrollBarParent(HWND)
int ChangeScrollBarMenu(HMENU)
int ChangeScrollBarPos(int x, int y, int width, int height)
int ChangeScrollBarStyles(DWORD dwstyle,DWORD dwexstyle)
int ChangeScrollBarName(LPCTSTR)
As a general rule
this functions return 1 on success, 0 on error.
After Created
Functions. (They help to handle the Scroll Bar):
INT GetPos()
Returns
the position of the Scroll.
INT
SetPos(INT value)
Moves
the scroll into the value position.
INT GetRange(INT* MinPos, INT* MaxPos) à Untested Function
Stores
the actual range of the ScrollBar into Minpos, and Maxpos.
INT SetRange(INT MinPos, INT MaxPos) à Tested Function
Sets the Range of the
scroll bar into the parameters MinPos…MaxPos.
Other Functions:
void InitScrollBar()
Initializes the
ScrollBar Class with these values:
lpWindowName="ScrollBar";
dwStyle=0;
x=10;
y=10;
nWidth=300;
nHeight=300;
hWndParent=NULL;
hMenu=NULL;
hInst1=programInstance;
_scrollbarcreated_=FALSE;
HWND
Create_ScrollBar(HWND AuxiliarWindow)
On success it returns the handle of
the scroll bar (you don’t have to store it, it is
already stored in the public class member “scrollbar”).
On error it return NULL.
int Destroy_ScrollBar()
Destroys the ScrollBar. On
error returns 0, else non-zero.
LONG
GetScrollBarId()
HWND
GetScrollBarParent()
DWORD
GetScrollBarExStyle()
DWORD
GetScrollBarStyle()
HINSTANCE
GetScrollBarInstance()
Returns a Scroll Bar property according
to the name of the Function.
BOOL
Is_Enabled()
void
Disable_ScrollBar()
void
Enable_ScrollBar()
cEasyScrollBar Private Members:
DWORD dwExStyle; // extended window style
LPCTSTR lpWindowName; // pointer to window name
DWORD dwStyle; // window style
int
x; // horizontal position of window
int
y; // vertical position of window
int
nWidth; // window width
int
nHeight; // window height
HWND hWndParent; // handle to parent or owner window
HMENU hMenu; // handle to menu or child-window
identifier
HANDLE hInst1; // handle to application instance
BOOL _scrollbarcreated_;