/*1* Flat Scrollbar control2*3* Copyright 1998, 1999 Eric Kohl4* Copyright 1998 Alex Priem5*6* This library is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* This library is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with this library; if not, write to the Free Software18* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA19*20* NOTES21* This is just a dummy control. An author is needed! Any volunteers?22* I will only improve this control once in a while.23* Eric <[email protected]>24*25* TODO:26* - All messages.27* - All notifications.28*29*/3031#include <stdarg.h>32#include <string.h>33#include "windef.h"34#include "winbase.h"35#include "winerror.h"36#include "winuser.h"37#include "commctrl.h"38#include "comctl32.h"39#include "wine/debug.h"4041WINE_DEFAULT_DEBUG_CHANNEL(commctrl);4243typedef struct44{45DWORD dwDummy; /* just to keep the compiler happy ;-) */46} FLATSB_INFO, *LPFLATSB_INFO;474849/***********************************************************************50* InitializeFlatSB (COMCTL32.@)51*52* Initializes flat scroll bars for the specified window.53*54* RETURNS55* Success: Non-zero56* Failure: Zero57*58* NOTES59* Subclasses specified window so that flat scroll bars may be drawn60* and used.61*/62BOOL WINAPI InitializeFlatSB(HWND hwnd)63{64TRACE("[%p]\n", hwnd);65return TRUE;66}6768/***********************************************************************69* UninitializeFlatSB (COMCTL32.@)70*71* Uninitializes flat scroll bars for the specified window.72*73* RETURNS74* E_FAIL if one of the scroll bars is currently in use75* S_FALSE if InitializeFlatSB() was never called on this hwnd76* S_OK otherwise77*78* NOTES79* Removes any subclassing on the specified window so that regular80* scroll bars are drawn and used.81*/82HRESULT WINAPI UninitializeFlatSB(HWND hwnd)83{84TRACE("[%p]\n", hwnd);85return S_FALSE;86}8788/***********************************************************************89* FlatSB_GetScrollProp (COMCTL32.@)90*91* Retrieves flat-scroll-bar-specific properties for the specified window.92*93* RETURNS94* nonzero if successful, or zero otherwise. If index is WSB_PROP_HSTYLE,95* the return is nonzero if InitializeFlatSB has been called for this window, or96* zero otherwise.97*/98BOOL WINAPI99FlatSB_GetScrollProp(HWND hwnd, INT propIndex, LPINT prop)100{101TRACE("[%p] propIndex=%d\n", hwnd, propIndex);102return FALSE;103}104105/***********************************************************************106* FlatSB_SetScrollProp (COMCTL32.@)107*108* Sets flat-scroll-bar-specific properties for the specified window.109*110* RETURNS111* Success: Non-zero112* Failure: Zero113*/114BOOL WINAPI115FlatSB_SetScrollProp(HWND hwnd, UINT index, INT newValue, BOOL flag)116{117TRACE("[%p] index=%u newValue=%d flag=%d\n", hwnd, index, newValue, flag);118return FALSE;119}120121/***********************************************************************122* From the Microsoft docs:123* "If flat scroll bars haven't been initialized for the124* window, the flat scroll bar APIs will defer to the corresponding125* standard APIs. This allows the developer to turn flat scroll126* bars on and off without having to write conditional code."127*128* So, if we just call the standard functions until we implement129* the flat scroll bar functions, flat scroll bars will show up and130* behave properly, as though they had simply not been setup to131* have flat properties.132*133* Susan <[email protected]>134*135*/136137/***********************************************************************138* FlatSB_EnableScrollBar (COMCTL32.@)139*140* See EnableScrollBar.141*/142BOOL WINAPI143FlatSB_EnableScrollBar(HWND hwnd, int nBar, UINT flags)144{145return EnableScrollBar(hwnd, nBar, flags);146}147148/***********************************************************************149* FlatSB_ShowScrollBar (COMCTL32.@)150*151* See ShowScrollBar.152*/153BOOL WINAPI154FlatSB_ShowScrollBar(HWND hwnd, int nBar, BOOL fShow)155{156return ShowScrollBar(hwnd, nBar, fShow);157}158159/***********************************************************************160* FlatSB_GetScrollRange (COMCTL32.@)161*162* See GetScrollRange.163*/164BOOL WINAPI165FlatSB_GetScrollRange(HWND hwnd, int nBar, LPINT min, LPINT max)166{167return GetScrollRange(hwnd, nBar, min, max);168}169170/***********************************************************************171* FlatSB_GetScrollInfo (COMCTL32.@)172*173* See GetScrollInfo.174*/175BOOL WINAPI176FlatSB_GetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info)177{178return GetScrollInfo(hwnd, nBar, info);179}180181/***********************************************************************182* FlatSB_GetScrollPos (COMCTL32.@)183*184* See GetScrollPos.185*/186INT WINAPI187FlatSB_GetScrollPos(HWND hwnd, int nBar)188{189return GetScrollPos(hwnd, nBar);190}191192/***********************************************************************193* FlatSB_SetScrollPos (COMCTL32.@)194*195* See SetScrollPos.196*/197INT WINAPI198FlatSB_SetScrollPos(HWND hwnd, int nBar, INT pos, BOOL bRedraw)199{200return SetScrollPos(hwnd, nBar, pos, bRedraw);201}202203/***********************************************************************204* FlatSB_SetScrollInfo (COMCTL32.@)205*206* See SetScrollInfo.207*/208INT WINAPI209FlatSB_SetScrollInfo(HWND hwnd, int nBar, LPSCROLLINFO info, BOOL bRedraw)210{211return SetScrollInfo(hwnd, nBar, info, bRedraw);212}213214/***********************************************************************215* FlatSB_SetScrollRange (COMCTL32.@)216*217* See SetScrollRange.218*/219INT WINAPI220FlatSB_SetScrollRange(HWND hwnd, int nBar, INT min, INT max, BOOL bRedraw)221{222return SetScrollRange(hwnd, nBar, min, max, bRedraw);223}224225226static LRESULT227FlatSB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)228{229TRACE("[%p] wParam %Ix, lParam %Ix\n", hwnd, wParam, lParam);230return 0;231}232233234static LRESULT235FlatSB_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)236{237TRACE("[%p] wParam %Ix, lParam %Ix\n", hwnd, wParam, lParam);238return 0;239}240241242static LRESULT WINAPI243FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)244{245if (!GetWindowLongPtrW(hwnd, 0) && (uMsg != WM_CREATE))246return DefWindowProcW( hwnd, uMsg, wParam, lParam );247248switch (uMsg)249{250case WM_CREATE:251return FlatSB_Create (hwnd, wParam, lParam);252253case WM_DESTROY:254return FlatSB_Destroy (hwnd, wParam, lParam);255256default:257if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))258ERR("unknown msg %04x, wp %#Ix, lp %#Ix\n", uMsg, wParam, lParam);259return DefWindowProcW (hwnd, uMsg, wParam, lParam);260}261}262263264VOID265FLATSB_Register (void)266{267WNDCLASSW wndClass;268269ZeroMemory (&wndClass, sizeof(WNDCLASSW));270wndClass.style = CS_GLOBALCLASS;271wndClass.lpfnWndProc = FlatSB_WindowProc;272wndClass.cbClsExtra = 0;273wndClass.cbWndExtra = sizeof(FLATSB_INFO *);274wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);275wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);276wndClass.lpszClassName = FLATSB_CLASSW;277278RegisterClassW (&wndClass);279}280281282VOID283FLATSB_Unregister (void)284{285UnregisterClassW (FLATSB_CLASSW, NULL);286}287288289