2 * Flat Scrollbar control
4 * Copyright 1998, 1999 Eric Kohl
5 * Copyright 1998 Alex Priem
8 * This is just a dummy control. An author is needed! Any volunteers?
9 * I will only improve this control once in a while.
10 * Eric <ekohl@abo.rhein-zeitung.de>
14 * - All notifications.
21 #include "debugtools.h"
23 DEFAULT_DEBUG_CHANNEL(commctrl
)
26 #define FlatSB_GetInfoPtr(hwnd) ((FLATSB_INFO*)GetWindowLongA (hwnd, 0))
29 /***********************************************************************
30 * FlatSB_EnableScrollBar
33 FlatSB_EnableScrollBar(HWND hwnd
, INT dummy
, UINT dummy2
)
39 /***********************************************************************
40 * FlatSB_ShowScrollBar
43 FlatSB_ShowScrollBar(HWND hwnd
, INT code
, BOOL flag
)
49 /***********************************************************************
50 * FlatSB_GetScrollRange
53 FlatSB_GetScrollRange(HWND hwnd
, INT code
, LPINT min
, LPINT max
)
59 /***********************************************************************
60 * FlatSB_GetScrollInfo
63 FlatSB_GetScrollInfo(HWND hwnd
, INT code
, LPSCROLLINFO info
)
69 /***********************************************************************
73 FlatSB_GetScrollPos(HWND hwnd
, INT code
)
79 /***********************************************************************
80 * FlatSB_GetScrollProp
83 FlatSB_GetScrollProp(HWND hwnd
, INT propIndex
, LPINT prop
)
89 /***********************************************************************
93 FlatSB_SetScrollPos(HWND hwnd
, INT code
, INT pos
, BOOL fRedraw
)
99 /***********************************************************************
100 * FlatSB_SetScrollInfo
103 FlatSB_SetScrollInfo(HWND hwnd
, INT code
, LPSCROLLINFO info
, BOOL fRedraw
)
109 /***********************************************************************
110 * FlatSB_SetScrollRange
113 FlatSB_SetScrollRange(HWND hwnd
, INT code
, INT min
, INT max
, BOOL fRedraw
)
119 /***********************************************************************
120 * FlatSB_SetScrollProp
123 FlatSB_SetScrollProp(HWND hwnd
, UINT index
, INT newValue
, BOOL flag
)
129 /***********************************************************************
132 BOOL WINAPI
InitializeFlatSB(HWND hwnd
)
138 /***********************************************************************
141 HRESULT WINAPI
UninitializeFlatSB(HWND hwnd
)
150 FlatSB_Create (HWND hwnd
, WPARAM wParam
, LPARAM lParam
)
157 FlatSB_Destroy (HWND hwnd
, WPARAM wParam
, LPARAM lParam
)
165 static LRESULT WINAPI
166 FlatSB_WindowProc (HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
172 return FlatSB_Create (hwnd
, wParam
, lParam
);
175 return FlatSB_Destroy (hwnd
, wParam
, lParam
);
179 ERR("unknown msg %04x wp=%08x lp=%08lx\n",
180 uMsg
, wParam
, lParam
);
181 return DefWindowProcA (hwnd
, uMsg
, wParam
, lParam
);
188 FLATSB_Register (void)
192 ZeroMemory (&wndClass
, sizeof(WNDCLASSA
));
193 wndClass
.style
= CS_GLOBALCLASS
;
194 wndClass
.lpfnWndProc
= (WNDPROC
)FlatSB_WindowProc
;
195 wndClass
.cbClsExtra
= 0;
196 wndClass
.cbWndExtra
= sizeof(FLATSB_INFO
*);
197 wndClass
.hCursor
= LoadCursorA (0, IDC_ARROWA
);
198 wndClass
.hbrBackground
= (HBRUSH
)(COLOR_WINDOW
+ 1);
199 wndClass
.lpszClassName
= FLATSB_CLASSA
;
201 RegisterClassA (&wndClass
);
206 FLATSB_Unregister (void)
208 UnregisterClassA (FLATSB_CLASSA
, (HINSTANCE
)NULL
);