diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index a1f1687dfb9..ab99c744c10 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -164,6 +164,7 @@ NtUserCallNoParam( #define ONEPARAM_ROUTINE_GETMENU 0x01 #define ONEPARAM_ROUTINE_ISWINDOWUNICODE 0x02 #define ONEPARAM_ROUTINE_WINDOWFROMDC 0x03 +#define ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID 0x04 DWORD STDCALL NtUserCallOneParam( @@ -175,6 +176,7 @@ NtUserCallOneParam( #define TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS 0x55 #define TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW 0x56 #define TWOPARAM_ROUTINE_VALIDATERGN 0x57 +#define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0x58 DWORD STDCALL NtUserCallTwoParam( diff --git a/reactos/lib/user32/windows/window.c b/reactos/lib/user32/windows/window.c index 8bfd288731e..c0df20ac030 100644 --- a/reactos/lib/user32/windows/window.c +++ b/reactos/lib/user32/windows/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.64 2003/08/17 23:48:36 weiden Exp $ +/* $Id: window.c,v 1.65 2003/08/18 00:11:17 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -1614,25 +1614,27 @@ ClientToScreen(HWND hWnd, LPPOINT lpPoint) } +/* + * @implemented + */ WINBOOL STDCALL SetWindowContextHelpId(HWND hwnd, DWORD dwContextHelpId) { - UNIMPLEMENTED; - return(FALSE); + return (WINBOOL)NtUserCallTwoParam((DWORD)hwnd, (DWORD)dwContextHelpId, + TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID); } /* - * @unimplemented + * @implemented */ DWORD STDCALL GetWindowContextHelpId(HWND hwnd) { - UNIMPLEMENTED; - return(0); + return NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID); } /* diff --git a/reactos/subsys/win32k/include/window.h b/reactos/subsys/win32k/include/window.h index 07e669e29f9..1f593194f3e 100644 --- a/reactos/subsys/win32k/include/window.h +++ b/reactos/subsys/win32k/include/window.h @@ -37,6 +37,8 @@ typedef struct _WINDOW_OBJECT INT y; INT Width; INT Height; + /* Context help id */ + DWORD ContextHelpId; /* Parent window handle. */ HWND ParentHandle; /* Window menu handle. */ diff --git a/reactos/subsys/win32k/ntuser/misc.c b/reactos/subsys/win32k/ntuser/misc.c index d49766d4895..c8cbdcc76d4 100644 --- a/reactos/subsys/win32k/ntuser/misc.c +++ b/reactos/subsys/win32k/ntuser/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.5 2003/08/17 09:17:04 weiden Exp $ +/* $Id: misc.c,v 1.6 2003/08/18 00:11:17 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -55,7 +55,9 @@ NtUserCallOneParam( SetLastWin32Error(ERROR_INVALID_HANDLE); return FALSE; } + Result = (DWORD)WindowObject->Menu; + W32kReleaseWindowObject(WindowObject); return Result; @@ -72,6 +74,19 @@ NtUserCallOneParam( case ONEPARAM_ROUTINE_WINDOWFROMDC: return (DWORD)W32kWindowFromDC((HDC)Param); + + case ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID: + WindowObject = W32kGetWindowObject((HWND)Param); + if(!WindowObject) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + + Result = WindowObject->ContextHelpId; + + W32kReleaseWindowObject(WindowObject); + return Result; } DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam()\n Param=0x%x\n", @@ -88,6 +103,7 @@ NtUserCallTwoParam( DWORD Param2, DWORD Routine) { + PWINDOW_OBJECT WindowObject; switch(Routine) { case TWOPARAM_ROUTINE_ENABLEWINDOW: @@ -108,6 +124,19 @@ NtUserCallTwoParam( case TWOPARAM_ROUTINE_VALIDATERGN: return (DWORD)NtUserValidateRgn((HWND) Param1, (HRGN) Param2); + + case TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID: + WindowObject = W32kGetWindowObject((HWND)Param1); + if(!WindowObject) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + + WindowObject->ContextHelpId = Param2; + + W32kReleaseWindowObject(WindowObject); + return TRUE; } DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam()\n Param1=0x%x Parm2=0x%x\n", diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index a926e0858b5..0030553422f 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: window.c,v 1.95 2003/08/17 19:07:11 silverblade Exp $ +/* $Id: window.c,v 1.96 2003/08/18 00:11:17 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -683,6 +683,7 @@ NtUserCreateWindowEx(DWORD dwExStyle, WindowObject->y = y; WindowObject->Width = nWidth; WindowObject->Height = nHeight; + WindowObject->ContextHelpId = 0; WindowObject->ParentHandle = hWndParent; WindowObject->Menu = hMenu; WindowObject->Instance = hInstance;