Use MZ_Current() instead of pModule->lpDosTask. Cleaned up the RMCB32
[wine/dcerpc.git] / dlls / comctl32 / flatsb.c
blob6213d3e4d22b5f3264139c924e9064d7bd8534b2
1 /*
2 * Flat Scrollbar control
4 * Copyright 1998, 1999 Eric Kohl
5 * Copyright 1998 Alex Priem
7 * NOTES
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>
12 * TODO:
13 * - All messages.
14 * - All notifications.
18 #include "winbase.h"
19 #include "winerror.h"
20 #include "commctrl.h"
21 #include "flatsb.h"
22 #include "debugtools.h"
24 DEFAULT_DEBUG_CHANNEL(commctrl)
27 #define FlatSB_GetInfoPtr(hwnd) ((FLATSB_INFO*)GetWindowLongA (hwnd, 0))
30 /***********************************************************************
31 * InitializeFlatSB
33 * returns nonzero if successful, zero otherwise
36 BOOL WINAPI InitializeFlatSB(HWND hwnd)
38 TRACE("[%04x]\n", hwnd);
39 FIXME("stub\n");
40 return FALSE;
43 /***********************************************************************
44 * UninitializeFlatSB
46 * returns:
47 * E_FAIL if one of the scroll bars is currently in use
48 * S_FALSE if InitializeFlatSB was never called on this hwnd
49 * S_OK otherwise
52 HRESULT WINAPI UninitializeFlatSB(HWND hwnd)
54 TRACE("[%04x]\n", hwnd);
55 FIXME("stub\n");
56 return S_FALSE;
59 /***********************************************************************
60 * FlatSB_GetScrollProp
62 * Returns nonzero if successful, or zero otherwise. If index is WSB_PROP_HSTYLE,
63 * the return is nonzero if InitializeFlatSB has been called for this window, or
64 * zero otherwise.
67 BOOL WINAPI
68 FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop)
70 TRACE("[%04x] propIndex=%d\n", hwnd, propIndex);
71 FIXME("stub\n");
72 return FALSE;
75 /***********************************************************************
76 * FlatSB_SetScrollProp
78 BOOL WINAPI
79 FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag)
81 TRACE("[%04x] index=%u newValue=%d flag=%d\n", hwnd, index, newValue, flag);
82 FIXME("stub\n");
83 return FALSE;
86 /***********************************************************************
87 * From the Microsoft docs:
88 * "If flat scroll bars haven't been initialized for the
89 * window, the flat scroll bar APIs will defer to the corresponding
90 * standard APIs. This allows the developer to turn flat scroll
91 * bars on and off without having to write conditional code."
93 * So, if we just call the standard functions until we implement
94 * the flat scroll bar functions, flat scroll bars will show up and
95 * behave properly, as though they had simply not been setup to
96 * have flat properties.
98 * Susan <sfarley@codeweavers.com>
102 /***********************************************************************
103 * FlatSB_EnableScrollBar
105 BOOL WINAPI
106 FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags)
108 return EnableScrollBar(hwnd, nBar, flags);
111 /***********************************************************************
112 * FlatSB_ShowScrollBar
114 BOOL WINAPI
115 FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow)
117 return ShowScrollBar(hwnd, nBar, fShow);
120 /***********************************************************************
121 * FlatSB_GetScrollRange
123 BOOL WINAPI
124 FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max)
126 return GetScrollRange(hwnd, nBar, min, max);
129 /***********************************************************************
130 * FlatSB_GetScrollInfo
132 BOOL WINAPI
133 FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info)
135 return GetScrollInfo(hwnd, nBar, info);
138 /***********************************************************************
139 * FlatSB_GetScrollPos
141 INT WINAPI
142 FlatSB_GetScrollPos(HWND hwnd, int nBar)
144 return GetScrollPos(hwnd, nBar);
147 /***********************************************************************
148 * FlatSB_SetScrollPos
150 INT WINAPI
151 FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw)
153 return SetScrollPos(hwnd, nBar, pos, bRedraw);
156 /***********************************************************************
157 * FlatSB_SetScrollInfo
159 INT WINAPI
160 FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw)
162 return SetScrollInfo(hwnd, nBar, info, bRedraw);
165 /***********************************************************************
166 * FlatSB_SetScrollRange
168 INT WINAPI
169 FlatSB_SetScrollRange(HWND hwnd, int nBar, INT min, INT max, BOOL bRedraw)
171 return SetScrollRange(hwnd, nBar, min, max, bRedraw);
175 static LRESULT
176 FlatSB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
178 TRACE("[%04x] wParam=%04x lParam=%08lx\n", hwnd, wParam, lParam);
179 return 0;
183 static LRESULT
184 FlatSB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
186 TRACE("[%04x] wParam=%04x lParam=%08lx\n", hwnd, wParam, lParam);
187 return 0;
191 static LRESULT WINAPI
192 FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
194 switch (uMsg)
196 case WM_CREATE:
197 return FlatSB_Create (hwnd, wParam, lParam);
199 case WM_DESTROY:
200 return FlatSB_Destroy (hwnd, wParam, lParam);
202 default:
203 if (uMsg >= WM_USER)
204 ERR("unknown msg %04x wp=%08x lp=%08lx\n",
205 uMsg, wParam, lParam);
206 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
208 return 0;
212 VOID
213 FLATSB_Register (void)
215 WNDCLASSA wndClass;
217 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
218 wndClass.style = CS_GLOBALCLASS;
219 wndClass.lpfnWndProc = (WNDPROC)FlatSB_WindowProc;
220 wndClass.cbClsExtra = 0;
221 wndClass.cbWndExtra = sizeof(FLATSB_INFO *);
222 wndClass.hCursor = LoadCursorA (0, IDC_ARROWA);
223 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
224 wndClass.lpszClassName = FLATSB_CLASSA;
226 RegisterClassA (&wndClass);
230 VOID
231 FLATSB_Unregister (void)
233 UnregisterClassA (FLATSB_CLASSA, (HINSTANCE)NULL);