- move IShellFolder_fnGetDisplayNameOf() contents into a new function
[wine/testsucceed.git] / dlls / comctl32 / flatsb.c
blobb13618fd2dc9e7ff8e90d5236fa93821afcdbd3a
1 /*
2 * Flat Scrollbar control
4 * Copyright 1998, 1999 Eric Kohl
5 * Copyright 1998 Alex Priem
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * NOTES
22 * This is just a dummy control. An author is needed! Any volunteers?
23 * I will only improve this control once in a while.
24 * Eric <ekohl@abo.rhein-zeitung.de>
26 * TODO:
27 * - All messages.
28 * - All notifications.
32 #include <stdarg.h>
33 #include <string.h>
34 #include "windef.h"
35 #include "winbase.h"
36 #include "winerror.h"
37 #include "wingdi.h"
38 #include "winuser.h"
39 #include "winnls.h"
40 #include "commctrl.h"
41 #include "wine/debug.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
45 typedef struct
47 DWORD dwDummy; /* just to keep the compiler happy ;-) */
48 } FLATSB_INFO, *LPFLATSB_INFO;
50 #define FlatSB_GetInfoPtr(hwnd) ((FLATSB_INFO*)GetWindowLongA (hwnd, 0))
53 /***********************************************************************
54 * InitializeFlatSB (COMCTL32.@)
56 * returns nonzero if successful, zero otherwise
59 BOOL WINAPI InitializeFlatSB(HWND hwnd)
61 TRACE("[%p]\n", hwnd);
62 return FALSE;
65 /***********************************************************************
66 * UninitializeFlatSB (COMCTL32.@)
68 * returns:
69 * E_FAIL if one of the scroll bars is currently in use
70 * S_FALSE if InitializeFlatSB was never called on this hwnd
71 * S_OK otherwise
74 HRESULT WINAPI UninitializeFlatSB(HWND hwnd)
76 TRACE("[%p]\n", hwnd);
77 return S_FALSE;
80 /***********************************************************************
81 * FlatSB_GetScrollProp (COMCTL32.@)
83 * Returns nonzero if successful, or zero otherwise. If index is WSB_PROP_HSTYLE,
84 * the return is nonzero if InitializeFlatSB has been called for this window, or
85 * zero otherwise.
88 BOOL WINAPI
89 FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop)
91 TRACE("[%p] propIndex=%d\n", hwnd, propIndex);
92 return FALSE;
95 /***********************************************************************
96 * FlatSB_SetScrollProp (COMCTL32.@)
98 BOOL WINAPI
99 FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag)
101 TRACE("[%p] index=%u newValue=%d flag=%d\n", hwnd, index, newValue, flag);
102 return FALSE;
105 /***********************************************************************
106 * From the Microsoft docs:
107 * "If flat scroll bars haven't been initialized for the
108 * window, the flat scroll bar APIs will defer to the corresponding
109 * standard APIs. This allows the developer to turn flat scroll
110 * bars on and off without having to write conditional code."
112 * So, if we just call the standard functions until we implement
113 * the flat scroll bar functions, flat scroll bars will show up and
114 * behave properly, as though they had simply not been setup to
115 * have flat properties.
117 * Susan <sfarley@codeweavers.com>
121 /***********************************************************************
122 * FlatSB_EnableScrollBar (COMCTL32.@)
124 BOOL WINAPI
125 FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags)
127 return EnableScrollBar(hwnd, nBar, flags);
130 /***********************************************************************
131 * FlatSB_ShowScrollBar (COMCTL32.@)
133 BOOL WINAPI
134 FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow)
136 return ShowScrollBar(hwnd, nBar, fShow);
139 /***********************************************************************
140 * FlatSB_GetScrollRange (COMCTL32.@)
142 BOOL WINAPI
143 FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max)
145 return GetScrollRange(hwnd, nBar, min, max);
148 /***********************************************************************
149 * FlatSB_GetScrollInfo (COMCTL32.@)
151 BOOL WINAPI
152 FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info)
154 return GetScrollInfo(hwnd, nBar, info);
157 /***********************************************************************
158 * FlatSB_GetScrollPos (COMCTL32.@)
160 INT WINAPI
161 FlatSB_GetScrollPos(HWND hwnd, int nBar)
163 return GetScrollPos(hwnd, nBar);
166 /***********************************************************************
167 * FlatSB_SetScrollPos (COMCTL32.@)
169 INT WINAPI
170 FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw)
172 return SetScrollPos(hwnd, nBar, pos, bRedraw);
175 /***********************************************************************
176 * FlatSB_SetScrollInfo (COMCTL32.@)
178 INT WINAPI
179 FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw)
181 return SetScrollInfo(hwnd, nBar, info, bRedraw);
184 /***********************************************************************
185 * FlatSB_SetScrollRange (COMCTL32.@)
187 INT WINAPI
188 FlatSB_SetScrollRange(HWND hwnd, int nBar, INT min, INT max, BOOL bRedraw)
190 return SetScrollRange(hwnd, nBar, min, max, bRedraw);
194 static LRESULT
195 FlatSB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
197 TRACE("[%p] wParam=%04x lParam=%08lx\n", hwnd, wParam, lParam);
198 return 0;
202 static LRESULT
203 FlatSB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
205 TRACE("[%p] wParam=%04x lParam=%08lx\n", hwnd, wParam, lParam);
206 return 0;
210 static LRESULT WINAPI
211 FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
213 if (!FlatSB_GetInfoPtr(hwnd) && (uMsg != WM_CREATE))
214 return DefWindowProcA( hwnd, uMsg, wParam, lParam );
216 switch (uMsg)
218 case WM_CREATE:
219 return FlatSB_Create (hwnd, wParam, lParam);
221 case WM_DESTROY:
222 return FlatSB_Destroy (hwnd, wParam, lParam);
224 default:
225 if ((uMsg >= WM_USER) && (uMsg < WM_APP))
226 ERR("unknown msg %04x wp=%08x lp=%08lx\n",
227 uMsg, wParam, lParam);
228 return DefWindowProcA (hwnd, uMsg, wParam, lParam);
230 return 0;
234 VOID
235 FLATSB_Register (void)
237 WNDCLASSA wndClass;
239 ZeroMemory (&wndClass, sizeof(WNDCLASSA));
240 wndClass.style = CS_GLOBALCLASS;
241 wndClass.lpfnWndProc = (WNDPROC)FlatSB_WindowProc;
242 wndClass.cbClsExtra = 0;
243 wndClass.cbWndExtra = sizeof(FLATSB_INFO *);
244 wndClass.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW);
245 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
246 wndClass.lpszClassName = FLATSB_CLASSA;
248 RegisterClassA (&wndClass);
252 VOID
253 FLATSB_Unregister (void)
255 UnregisterClassA (FLATSB_CLASSA, NULL);