Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

sbapi.c

Go to the documentation of this file.
00001 /**************************** Module Header ********************************\ 00002 * Module Name: 00003 * 00004 * Copyright (c) 1985 - 1999, Microsoft Corporation 00005 * 00006 * Scroll bar public APIs 00007 * 00008 * History: 00009 * 08-16-95 FritzS 00010 \***************************************************************************/ 00011 00012 #include "precomp.h" 00013 #pragma hdrstop 00014 00015 /***************************************************************************\ 00016 * SetScrollPos 00017 * 00018 * History: 00019 \***************************************************************************/ 00020 00021 int SetScrollPos( 00022 HWND hwnd, 00023 int code, 00024 int pos, 00025 BOOL fRedraw) 00026 { 00027 SCROLLINFO si; 00028 00029 si.fMask = SIF_POS | SIF_RETURNOLDPOS; 00030 si.nPos = pos; 00031 si.cbSize = sizeof(SCROLLINFO); 00032 00033 return((int) NtUserSetScrollInfo(hwnd, code, &si, fRedraw)); 00034 } 00035 00036 00037 /***************************************************************************\ 00038 * SetScrollRange 00039 * 00040 * History: 00041 * 16-May-1991 mikeke Changed to return BOOL 00042 \***************************************************************************/ 00043 00044 BOOL SetScrollRange( 00045 HWND hwnd, 00046 int code, 00047 int posMin, 00048 int posMax, 00049 BOOL fRedraw) 00050 { 00051 SCROLLINFO si; 00052 00053 /* 00054 * Validate the window handle first, because the further call 00055 * to NtUserSetScrollInfo will return the position of the scrollbar 00056 * and not FALSE if the hwnd is invalid 00057 */ 00058 if ( ValidateHwnd((hwnd)) == NULL) 00059 return FALSE; 00060 00061 /* 00062 * Check if the 'Range'(Max - Min) can be represented by an integer; 00063 * If not, it is an error; 00064 * Fix for Bug #1089 -- SANKAR -- 20th Sep, 1989 --. 00065 */ 00066 if ((unsigned int)(posMax - posMin) > MAXLONG) { 00067 RIPERR0(ERROR_INVALID_SCROLLBAR_RANGE, RIP_VERBOSE, ""); 00068 return FALSE; 00069 } 00070 00071 si.fMask = SIF_RANGE; 00072 si.nMin = posMin; 00073 si.nMax = posMax; 00074 si.cbSize = sizeof(SCROLLINFO); 00075 00076 NtUserSetScrollInfo(hwnd, code, &si, fRedraw); 00077 00078 return TRUE; 00079 }

Generated on Sat May 15 19:41:43 2004 for test by doxygen 1.3.7