diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index 0ad9bfc4821..57e4a92eba3 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -186,6 +186,14 @@ NtUserCallOneParam( DWORD Param, DWORD Routine); +#define TWOPARAM_ROUTINE_SETMENUITEMRECT 0x51 +#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0x52 + #define TPR_SGTH_ACTIVE 0x01 + #define TPR_SGTH_FOCUS 0x02 + #define TPR_SGTH_CAPTURE 0x03 + #define TPR_SGTH_MENUOWNER 0x04 + #define TPR_SGTH_MOVESIZE 0x05 + #define TPR_SGTH_CARET 0x06 #define TWOPARAM_ROUTINE_ENABLEWINDOW 0x53 #define TWOPARAM_ROUTINE_UNKNOWN 0x54 #define TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS 0x55 @@ -1867,6 +1875,13 @@ NtUserSetScrollBarInfo( LONG idObject, SETSCROLLBARINFO *info); +typedef struct _SETMENUITEMRECT +{ + UINT uItem; + BOOL fByPosition; + RECT rcRect; +} SETMENUITEMRECT, *PSETMENUITEMRECT; + #endif /* __WIN32K_NTUSER_H */ /* EOF */ diff --git a/reactos/lib/user32/include/user32.h b/reactos/lib/user32/include/user32.h index f50e6cbd4ea..f6a0fa45ac2 100644 --- a/reactos/lib/user32/include/user32.h +++ b/reactos/lib/user32/include/user32.h @@ -30,3 +30,52 @@ VOID CreateFrameBrushes(VOID); VOID DeleteFrameBrushes(VOID); void DrawCaret(HWND hWnd, PTHRDCARETINFO CaretInfo); + +#define NtUserValidateRgn(hWnd, hRgn) \ + (BOOL)NtUserCallTwoParam((DWORD)hWnd, (DWORD)hRgn, TWOPARAM_ROUTINE_VALIDATERGN) + +#define NtUserSetWindowContextHelpId(hWnd, dwContextHelpId) \ + (BOOL)NtUserCallTwoParam((DWORD)hwnd, dwContextHelpId, TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID) + +#define NtUserSetCaretPos(X, Y) \ + (BOOL)NtUserCallTwoParam((DWORD)X, (DWORD)Y, TWOPARAM_ROUTINE_SETCARETPOS) + +#define NtUserGetCursorPos(lpPoint) \ + (BOOL)NtUserCallTwoParam((DWORD)lpPoint, (DWORD)FALSE, TWOPARAM_ROUTINE_CURSORPOSITION) + +#define NtUserSetCursorPos(lpPoint) \ + (BOOL)NtUserCallTwoParam((DWORD)lpPoint, (DWORD)TRUE, TWOPARAM_ROUTINE_CURSORPOSITION) + +#define NtUserSetGUIThreadHandle(field, hwnd) \ + (BOOL)NtUserCallTwoParam((DWORD)field, (DWORD)hwnd, TWOPARAM_ROUTINE_SETGUITHRDHANDLE) + +#define NtUserSetMenuItemRect(menu, mir) \ + (BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)mir, TWOPARAM_ROUTINE_SETMENUITEMRECT) + +#define NtUserSetCaretBlinkTime(uMSeconds) \ + (BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME) + +#define NtUserEnumClipboardFormats(format) \ + (UINT)NtUserCallOneParam(format, ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS) + +#define NtUserWindowFromDC(hDC) \ + (HWND)NtUserCallOneParam((DWORD)hDC, ONEPARAM_ROUTINE_WINDOWFROMDC) + +#define NtUserSwitchCaretShowing(CaretInfo) \ + (BOOL)NtUserCallOneParam((DWORD)CaretInfo, ONEPARAM_ROUTINE_SWITCHCARETSHOWING) + +#define NtUserSwapMouseButton(fSwap) \ + (BOOL)NtUserCallOneParam((DWORD)fSwap, ONEPARAM_ROUTINE_SWAPMOUSEBUTTON) + +#define NtUserGetMenu(hWnd) \ + (HMENU)NtUserCallOneParam((DWORD)hWnd, ONEPARAM_ROUTINE_GETMENU) + +#define NtUserSetMessageExtraInfo(lParam) \ + (LPARAM)NtUserCallOneParam((DWORD)lParam, ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO) + +#define NtUserIsWindowUnicode(hWnd) \ + (BOOL)NtUserCallOneParam((DWORD)hWnd, ONEPARAM_ROUTINE_ISWINDOWUNICODE) + +#define NtUserGetWindowContextHelpId(hwnd) \ + NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID) + diff --git a/reactos/lib/user32/windows/caret.c b/reactos/lib/user32/windows/caret.c index 5337c2f6e0e..1673565c2c7 100644 --- a/reactos/lib/user32/windows/caret.c +++ b/reactos/lib/user32/windows/caret.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: caret.c,v 1.6 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: caret.c,v 1.7 2004/01/26 08:44:51 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/caret.c @@ -120,7 +120,7 @@ HideCaret(HWND hWnd) BOOL STDCALL SetCaretBlinkTime(UINT uMSeconds) { - return (BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME); + return NtUserSetCaretBlinkTime(uMSeconds); } @@ -131,7 +131,7 @@ BOOL STDCALL SetCaretPos(int X, int Y) { - return (BOOL)NtUserCallTwoParam((DWORD)X, (DWORD)Y, TWOPARAM_ROUTINE_SETCARETPOS); + return NtUserSetCaretPos(X, Y); } diff --git a/reactos/lib/user32/windows/clipboard.c b/reactos/lib/user32/windows/clipboard.c index d478100bc36..35791228665 100644 --- a/reactos/lib/user32/windows/clipboard.c +++ b/reactos/lib/user32/windows/clipboard.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: clipboard.c,v 1.12 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: clipboard.c,v 1.13 2004/01/26 08:44:51 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/clipboard.c @@ -79,7 +79,7 @@ EmptyClipboard(VOID) UINT STDCALL EnumClipboardFormats(UINT format) { - return (UINT)NtUserCallOneParam(format, ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS); + return NtUserEnumClipboardFormats(format); } /* diff --git a/reactos/lib/user32/windows/cursor.c b/reactos/lib/user32/windows/cursor.c index 13828aeded2..f7b903ed70c 100644 --- a/reactos/lib/user32/windows/cursor.c +++ b/reactos/lib/user32/windows/cursor.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: cursor.c,v 1.18 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: cursor.c,v 1.19 2004/01/26 08:44:51 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/cursor.c @@ -171,8 +171,7 @@ GetCursorPos(LPPOINT lpPoint) return FALSE; } - res = (BOOL)NtUserCallTwoParam((DWORD)lpPoint, (DWORD)FALSE, - TWOPARAM_ROUTINE_CURSORPOSITION); + res = NtUserGetCursorPos(lpPoint); return res; } @@ -261,8 +260,7 @@ SetCursorPos(int X, POINT pos; pos.x = (LONG)X; pos.y = (LONG)Y; - return (BOOL)NtUserCallTwoParam((DWORD)&pos, (DWORD)TRUE, - TWOPARAM_ROUTINE_CURSORPOSITION); + return NtUserSetCursorPos(&pos); } diff --git a/reactos/lib/user32/windows/dc.c b/reactos/lib/user32/windows/dc.c index e8030e037f1..f01527bc4d1 100644 --- a/reactos/lib/user32/windows/dc.c +++ b/reactos/lib/user32/windows/dc.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: dc.c,v 1.14 2003/09/26 20:58:06 gvg Exp $ +/* $Id: dc.c,v 1.15 2004/01/26 08:44:51 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -93,5 +93,5 @@ STDCALL WindowFromDC( HDC hDC) { - return (HWND)NtUserCallOneParam((DWORD)hDC, ONEPARAM_ROUTINE_WINDOWFROMDC); + return NtUserWindowFromDC(hDC); } diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index cac40b7b354..6927255d0a6 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.122 2004/01/14 21:28:24 gvg Exp $ +/* $Id: defwnd.c,v 1.123 2004/01/26 08:44:51 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -1408,7 +1408,7 @@ User32DefWindowProc(HWND hWnd, { case 0xffff: /* Caret timer */ /* switch showing byte in win32k and get information about the caret */ - if(NtUserCallOneParam((DWORD)&CaretInfo, ONEPARAM_ROUTINE_SWITCHCARETSHOWING) && (CaretInfo.hWnd == hWnd)) + if(NtUserSwitchCaretShowing(&CaretInfo) && (CaretInfo.hWnd == hWnd)) { DrawCaret(hWnd, &CaretInfo); } diff --git a/reactos/lib/user32/windows/input.c b/reactos/lib/user32/windows/input.c index f72a5a23442..426ab24fadb 100644 --- a/reactos/lib/user32/windows/input.c +++ b/reactos/lib/user32/windows/input.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: input.c,v 1.22 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: input.c,v 1.23 2004/01/26 08:44:51 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -389,8 +389,7 @@ STDCALL SwapMouseButton( BOOL fSwap) { - return (BOOL)NtUserCallOneParam((DWORD)fSwap, - ONEPARAM_ROUTINE_SWAPMOUSEBUTTON); + return NtUserSwapMouseButton(fSwap); } diff --git a/reactos/lib/user32/windows/menu.c b/reactos/lib/user32/windows/menu.c index 48317dc3887..807fd4a8325 100644 --- a/reactos/lib/user32/windows/menu.c +++ b/reactos/lib/user32/windows/menu.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: menu.c,v 1.41 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: menu.c,v 1.42 2004/01/26 08:44:51 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/menu.c @@ -625,7 +625,7 @@ EndMenu(VOID) HMENU STDCALL GetMenu(HWND hWnd) { - return (HMENU)NtUserCallOneParam((DWORD)hWnd, ONEPARAM_ROUTINE_GETMENU); + return NtUserGetMenu(hWnd); } diff --git a/reactos/lib/user32/windows/message.c b/reactos/lib/user32/windows/message.c index fdddbbbc1ff..b4db4383424 100644 --- a/reactos/lib/user32/windows/message.c +++ b/reactos/lib/user32/windows/message.c @@ -1,4 +1,4 @@ -/* $Id: message.c,v 1.33 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: message.c,v 1.34 2004/01/26 08:44:51 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -92,7 +92,7 @@ STDCALL SetMessageExtraInfo( LPARAM lParam) { - return (LPARAM)NtUserCallOneParam((DWORD)lParam, ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO); + return NtUserSetMessageExtraInfo(lParam); } diff --git a/reactos/lib/user32/windows/paint.c b/reactos/lib/user32/windows/paint.c index 2ae089fc321..ada6e1be3f0 100644 --- a/reactos/lib/user32/windows/paint.c +++ b/reactos/lib/user32/windows/paint.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: paint.c,v 1.21 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: paint.c,v 1.22 2004/01/26 08:44:51 weiden Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -253,9 +253,7 @@ ValidateRgn( HWND hWnd, HRGN hRgn) { - return (BOOL) NtUserCallTwoParam((DWORD) hWnd, - (DWORD) hRgn, - TWOPARAM_ROUTINE_VALIDATERGN); + return NtUserValidateRgn(hWnd, hRgn); } diff --git a/reactos/lib/user32/windows/window.c b/reactos/lib/user32/windows/window.c index 8e1284d16a4..a289288916b 100644 --- a/reactos/lib/user32/windows/window.c +++ b/reactos/lib/user32/windows/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.95 2004/01/23 23:38:26 ekohl Exp $ +/* $Id: window.c,v 1.96 2004/01/26 08:44:51 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -1060,7 +1060,7 @@ IsWindow(HWND hWnd) BOOL STDCALL IsWindowUnicode(HWND hWnd) { - return (BOOL)NtUserCallOneParam((DWORD)hWnd,ONEPARAM_ROUTINE_ISWINDOWUNICODE); + return NtUserIsWindowUnicode(hWnd); } @@ -1421,8 +1421,7 @@ STDCALL SetWindowContextHelpId(HWND hwnd, DWORD dwContextHelpId) { - return (BOOL)NtUserCallTwoParam((DWORD)hwnd, (DWORD)dwContextHelpId, - TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID); + return NtUserSetWindowContextHelpId(hwnd, dwContextHelpId); } @@ -1433,7 +1432,7 @@ DWORD STDCALL GetWindowContextHelpId(HWND hwnd) { - return NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID); + return NtUserGetWindowContextHelpId(hwnd); } /* diff --git a/reactos/subsys/win32k/ntuser/misc.c b/reactos/subsys/win32k/ntuser/misc.c index 918957cb7d1..2a08446f280 100644 --- a/reactos/subsys/win32k/ntuser/misc.c +++ b/reactos/subsys/win32k/ntuser/misc.c @@ -1,4 +1,4 @@ -/* $Id: misc.c,v 1.42 2003/12/28 14:14:03 navaraf Exp $ +/* $Id: misc.c,v 1.43 2004/01/26 08:44:51 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -195,6 +195,41 @@ NtUserCallTwoParam( switch(Routine) { + case TWOPARAM_ROUTINE_SETMENUITEMRECT: + UNIMPLEMENTED + return 0; + + case TWOPARAM_ROUTINE_SETGUITHRDHANDLE: + { + HWND *hwnd; + PUSER_MESSAGE_QUEUE MsgQueue = PsGetCurrentThread()->Win32Thread->MessageQueue; + + switch(Param1) + { + case TPR_SGTH_ACTIVE: + hwnd = &MsgQueue->ActiveWindow; + break; + case TPR_SGTH_FOCUS: + hwnd = &MsgQueue->FocusWindow; + break; + case TPR_SGTH_CAPTURE: + hwnd = &MsgQueue->CaptureWindow; + break; + case TPR_SGTH_MENUOWNER: + hwnd = &MsgQueue->MenuOwner; + break; + case TPR_SGTH_MOVESIZE: + hwnd = &MsgQueue->MoveSize; + break; + case TPR_SGTH_CARET: + hwnd = &MsgQueue->CaretInfo->hWnd; + break; + default: + return 0; + } + return (DWORD)(*hwnd = (HWND)Param2); + } + case TWOPARAM_ROUTINE_ENABLEWINDOW: UNIMPLEMENTED return 0;