added syscall NtUserGetScrollInfo() and fixed nonclient hittest for caption buttons

svn path=/trunk/; revision=6006
This commit is contained in:
Thomas Bluemel 2003-09-07 11:52:54 +00:00
parent f54139ad6e
commit 1a1d4a8874
4 changed files with 141 additions and 16 deletions

View file

@ -405,6 +405,7 @@ NtUserGetProp 2
NtUserGetPriorityClipboardFormat 2 NtUserGetPriorityClipboardFormat 2
NtUserGetProcessWindowStation 0 NtUserGetProcessWindowStation 0
NtUserGetScrollBarInfo 3 NtUserGetScrollBarInfo 3
NtUserGetScrollInfo 3
NtUserGetSystemMenu 2 NtUserGetSystemMenu 2
NtUserGetSystemMetrics 1 NtUserGetSystemMetrics 1
NtUserGetThreadDesktop 2 NtUserGetThreadDesktop 2

View file

@ -823,9 +823,19 @@ HWINSTA
STDCALL STDCALL
NtUserGetProcessWindowStation(VOID); NtUserGetProcessWindowStation(VOID);
DWORD BOOL
STDCALL STDCALL
NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi); NtUserGetScrollBarInfo(
HWND hWnd,
LONG idObject,
PSCROLLBARINFO psbi);
BOOL
STDCALL
NtUserGetScrollInfo(
HWND hwnd,
int fnBar,
LPSCROLLINFO lpsi);
HMENU HMENU
STDCALL STDCALL

View file

@ -1,4 +1,4 @@
/* $Id: defwnd.c,v 1.79 2003/09/07 09:55:52 weiden Exp $ /* $Id: defwnd.c,v 1.80 2003/09/07 11:52:54 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -800,7 +800,7 @@ DefWndHitTestNC(HWND hWnd, POINT Point)
if (Style & WS_MAXIMIZEBOX || Style & WS_MINIMIZEBOX) if (Style & WS_MAXIMIZEBOX || Style & WS_MINIMIZEBOX)
{ {
WindowRect.right -= GetSystemMetrics(SM_CXSIZE) - 2; WindowRect.right -= GetSystemMetrics(SM_CXSIZE);
} }
if (Point.x >= WindowRect.right) if (Point.x >= WindowRect.right)
{ {
@ -809,7 +809,7 @@ DefWndHitTestNC(HWND hWnd, POINT Point)
if (Style & WS_MINIMIZEBOX) if (Style & WS_MINIMIZEBOX)
{ {
WindowRect.right -= GetSystemMetrics(SM_CXSIZE) - 2; WindowRect.right -= GetSystemMetrics(SM_CXSIZE);
} }
if (Point.x >= WindowRect.right) if (Point.x >= WindowRect.right)
{ {

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: scrollbar.c,v 1.9 2003/09/07 09:55:52 weiden Exp $ /* $Id: scrollbar.c,v 1.10 2003/09/07 11:52:54 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -45,6 +45,14 @@
#define SCROLL_MIN_RECT 4 /* Minimum size of the rectangle between the arrows */ #define SCROLL_MIN_RECT 4 /* Minimum size of the rectangle between the arrows */
#define SCROLL_ARROW_THUMB_OVERLAP 0 /* Overlap between arrows and thumb */ #define SCROLL_ARROW_THUMB_OVERLAP 0 /* Overlap between arrows and thumb */
#define SBRG_SCROLLBAR 0 /* the scrollbar itself */
#define SBRG_TOPRIGHTBTN 1 /* the top or right button */
#define SBRG_PAGEUPRIGHT 2 /* the page up or page right region */
#define SBRG_SCROLLBOX 3 /* the scroll box */
#define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */
#define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
/* Ported from WINE20020904 */ /* Ported from WINE20020904 */
@ -122,7 +130,7 @@ IntCreateScrollBar(PWINDOW_OBJECT Window, LONG idObject)
psbi->cbSize = sizeof(SCROLLBARINFO); psbi->cbSize = sizeof(SCROLLBARINFO);
for (i=0; i<CCHILDREN_SCROLLBAR+1; i++) for (i = 0; i < CCHILDREN_SCROLLBAR + 1; i++)
psbi->rgstate[i] = 0; psbi->rgstate[i] = 0;
switch(idObject) switch(idObject)
@ -180,7 +188,7 @@ IntDestroyScrollBar(PWINDOW_OBJECT Window, LONG idObject)
} }
DWORD BOOL
STDCALL STDCALL
NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi) NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
{ {
@ -203,14 +211,26 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
switch(idObject) switch(idObject)
{ {
case SB_HORZ: case SB_HORZ:
memcpy(psbi, Window->pHScroll, sizeof(SCROLLBARINFO)); if(Window->pHScroll)
break; {
memcpy(psbi, Window->pHScroll, sizeof(SCROLLBARINFO));
break;
}
/* fall through */
case SB_VERT: case SB_VERT:
memcpy(psbi, Window->pVScroll, sizeof(SCROLLBARINFO)); if(Window->pVScroll)
break; {
memcpy(psbi, Window->pVScroll, sizeof(SCROLLBARINFO));
break;
}
/* fall through */
case SB_CTL: case SB_CTL:
memcpy(psbi, Window->wExtra, sizeof(SCROLLBARINFO)); if(Window->wExtra)
break; {
memcpy(psbi, Window->wExtra, sizeof(SCROLLBARINFO));
break;
}
/* fall through */
default: default:
IntReleaseWindowObject(Window); IntReleaseWindowObject(Window);
SetLastWin32Error(ERROR_INVALID_PARAMETER); SetLastWin32Error(ERROR_INVALID_PARAMETER);
@ -223,6 +243,43 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
return TRUE; return TRUE;
} }
BOOL
STDCALL
NtUserGetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi)
{
PWINDOW_OBJECT Window;
PSCROLLBARINFO Info = NULL;
Window = IntGetWindowObject(hwnd);
if(!Window)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return FALSE;
}
switch(fnBar)
{
case SB_HORZ:
Info = Window->pHScroll;
break;
case SB_VERT:
Info = Window->pVScroll;
break;
case SB_CTL:
Info = Window->wExtra;
break;
default:
IntReleaseWindowObject(Window);
return FALSE;
}
IntReleaseWindowObject(Window);
return FALSE;
}
DWORD DWORD
STDCALL STDCALL
NtUserEnableScrollBar( NtUserEnableScrollBar(
@ -230,7 +287,38 @@ NtUserEnableScrollBar(
UINT wSBflags, UINT wSBflags,
UINT wArrows) UINT wArrows)
{ {
return 0; PWINDOW_OBJECT Window;
PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
Window = IntGetWindowObject(hWnd);
if(!Window)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return FALSE;
}
switch(wSBflags)
{
case SB_BOTH:
InfoV = Window->pVScroll;
/* fall through */
case SB_HORZ:
InfoH = Window->pHScroll;
break;
case SB_VERT:
InfoV = Window->pVScroll;
break;
case SB_CTL:
InfoV = Window->wExtra;
break;
default:
IntReleaseWindowObject(Window);
return FALSE;
}
IntReleaseWindowObject(Window);
return TRUE;
} }
DWORD DWORD
@ -258,8 +346,34 @@ NtUserSetScrollInfo(
LPCSCROLLINFO lpsi, LPCSCROLLINFO lpsi,
WINBOOL fRedraw) WINBOOL fRedraw)
{ {
UNIMPLEMENTED PWINDOW_OBJECT Window;
PSCROLLBARINFO Info = NULL;
Window = IntGetWindowObject(hwnd);
if(!Window)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return 0;
}
switch(fnBar)
{
case SB_HORZ:
Info = Window->pHScroll;
break;
case SB_VERT:
Info = Window->pVScroll;
break;
case SB_CTL:
Info = Window->wExtra;
break;
default:
IntReleaseWindowObject(Window);
return 0;
}
IntReleaseWindowObject(Window);
return 0; return 0;
} }