mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:36:13 +00:00
implemented GetWindowInfo()
svn path=/trunk/; revision=8953
This commit is contained in:
parent
b8560b708d
commit
6491031cc2
7 changed files with 105 additions and 56 deletions
|
@ -197,6 +197,7 @@ NtUserCallOneParam(
|
||||||
#define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0x58
|
#define TWOPARAM_ROUTINE_SETWNDCONTEXTHLPID 0x58
|
||||||
#define TWOPARAM_ROUTINE_CURSORPOSITION 0x59
|
#define TWOPARAM_ROUTINE_CURSORPOSITION 0x59
|
||||||
#define TWOPARAM_ROUTINE_SETCARETPOS 0x60
|
#define TWOPARAM_ROUTINE_SETCARETPOS 0x60
|
||||||
|
#define TWOPARAM_ROUTINE_GETWINDOWINFO 0x61
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserCallTwoParam(
|
NtUserCallTwoParam(
|
||||||
|
|
|
@ -55,6 +55,9 @@ void DrawCaret(HWND hWnd, PTHRDCARETINFO CaretInfo);
|
||||||
#define NtUserSetMenuBarHeight(menu, height) \
|
#define NtUserSetMenuBarHeight(menu, height) \
|
||||||
(BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)height, TWOPARAM_ROUTINE_SETMENUBARHEIGHT)
|
(BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)height, TWOPARAM_ROUTINE_SETMENUBARHEIGHT)
|
||||||
|
|
||||||
|
#define NtUserGetWindowInfo(hwnd, pwi) \
|
||||||
|
(BOOL)NtUserCallTwoParam((DWORD)hwnd, (DWORD)pwi, TWOPARAM_ROUTINE_GETWINDOWINFO)
|
||||||
|
|
||||||
#define NtUserSetCaretBlinkTime(uMSeconds) \
|
#define NtUserSetCaretBlinkTime(uMSeconds) \
|
||||||
(BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME)
|
(BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: window.c,v 1.102 2004/03/14 11:27:33 gvg Exp $
|
/* $Id: window.c,v 1.103 2004/04/02 20:51:07 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
|
||||||
|
@ -890,14 +890,13 @@ GetTopWindow(HWND hWnd)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
GetWindowInfo(HWND hwnd,
|
GetWindowInfo(HWND hwnd,
|
||||||
PWINDOWINFO pwi)
|
PWINDOWINFO pwi)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
return NtUserGetWindowInfo(hwnd, pwi);
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,17 @@ typedef struct _WINDOW_OBJECT
|
||||||
#define WINDOWSTATUS_DESTROYING (0x1)
|
#define WINDOWSTATUS_DESTROYING (0x1)
|
||||||
#define WINDOWSTATUS_DESTROYED (0x2)
|
#define WINDOWSTATUS_DESTROYED (0x2)
|
||||||
|
|
||||||
|
#define HAS_DLGFRAME(Style, ExStyle) \
|
||||||
|
(((ExStyle) & WS_EX_DLGMODALFRAME) || \
|
||||||
|
(((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
|
||||||
|
|
||||||
|
#define HAS_THICKFRAME(Style, ExStyle) \
|
||||||
|
(((Style) & WS_THICKFRAME) && \
|
||||||
|
(!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
|
||||||
|
|
||||||
|
#define HAS_THINFRAME(Style, ExStyle) \
|
||||||
|
(((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
|
||||||
|
|
||||||
#define IntIsDesktopWindow(WndObj) \
|
#define IntIsDesktopWindow(WndObj) \
|
||||||
(WndObj->Parent == NULL)
|
(WndObj->Parent == NULL)
|
||||||
|
|
||||||
|
@ -194,6 +205,12 @@ IntGetWindowRgn(HWND hWnd, HRGN hRgn);
|
||||||
INT FASTCALL
|
INT FASTCALL
|
||||||
IntGetWindowRgnBox(HWND hWnd, RECT *Rect);
|
IntGetWindowRgnBox(HWND hWnd, RECT *Rect);
|
||||||
|
|
||||||
|
BOOL FASTCALL
|
||||||
|
IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, INT *cx, INT *cy);
|
||||||
|
|
||||||
DWORD IntRemoveWndProcHandle(WNDPROC Handle);
|
DWORD IntRemoveWndProcHandle(WNDPROC Handle);
|
||||||
DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
|
DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
|
||||||
DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
|
DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: misc.c,v 1.55 2004/03/23 21:47:37 weiden Exp $
|
/* $Id: misc.c,v 1.56 2004/04/02 20:51:08 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -369,6 +369,40 @@ NtUserCallTwoParam(
|
||||||
|
|
||||||
case TWOPARAM_ROUTINE_SETCARETPOS:
|
case TWOPARAM_ROUTINE_SETCARETPOS:
|
||||||
return (DWORD)IntSetCaretPos((int)Param1, (int)Param2);
|
return (DWORD)IntSetCaretPos((int)Param1, (int)Param2);
|
||||||
|
|
||||||
|
case TWOPARAM_ROUTINE_GETWINDOWINFO:
|
||||||
|
{
|
||||||
|
WINDOWINFO wi;
|
||||||
|
DWORD Ret;
|
||||||
|
|
||||||
|
if(!(WindowObject = IntGetWindowObject((HWND)Param1)))
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = MmCopyFromCaller(&wi.cbSize, (PVOID)Param2, sizeof(wi.cbSize));
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
IntReleaseWindowObject(WindowObject);
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((Ret = (DWORD)IntGetWindowInfo(WindowObject, &wi)))
|
||||||
|
{
|
||||||
|
Status = MmCopyToCaller((PVOID)Param2, &wi, sizeof(WINDOWINFO));
|
||||||
|
if(!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
IntReleaseWindowObject(WindowObject);
|
||||||
|
SetLastNtError(Status);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IntReleaseWindowObject(WindowObject);
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam()\n Param1=0x%x Parm2=0x%x\n",
|
DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam()\n Param1=0x%x Parm2=0x%x\n",
|
||||||
Routine, Param1, Param2);
|
Routine, Param1, Param2);
|
||||||
|
|
|
@ -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: window.c,v 1.207 2004/03/31 19:44:34 weiden Exp $
|
/* $Id: window.c,v 1.208 2004/04/02 20:51:08 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -430,6 +430,48 @@ static LRESULT IntDestroyWindow(PWINDOW_OBJECT Window,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, INT *cx, INT *cy)
|
||||||
|
{
|
||||||
|
if(HAS_DLGFRAME(WindowObject->Style, WindowObject->ExStyle) && !(WindowObject->Style & WS_MINIMIZE))
|
||||||
|
{
|
||||||
|
*cx = NtUserGetSystemMetrics(SM_CXDLGFRAME);
|
||||||
|
*cy = NtUserGetSystemMetrics(SM_CYDLGFRAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(HAS_THICKFRAME(WindowObject->Style, WindowObject->ExStyle)&& !(WindowObject->Style & WS_MINIMIZE))
|
||||||
|
{
|
||||||
|
*cx = NtUserGetSystemMetrics(SM_CXFRAME);
|
||||||
|
*cy = NtUserGetSystemMetrics(SM_CYFRAME);
|
||||||
|
}
|
||||||
|
else if(HAS_THINFRAME(WindowObject->Style, WindowObject->ExStyle))
|
||||||
|
{
|
||||||
|
*cx = NtUserGetSystemMetrics(SM_CXBORDER);
|
||||||
|
*cy = NtUserGetSystemMetrics(SM_CYBORDER);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*cx = *cy = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL FASTCALL
|
||||||
|
IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi)
|
||||||
|
{
|
||||||
|
pwi->cbSize = sizeof(WINDOWINFO);
|
||||||
|
pwi->rcWindow = WindowObject->WindowRect;
|
||||||
|
pwi->rcClient = WindowObject->ClientRect;
|
||||||
|
pwi->dwStyle = WindowObject->Style;
|
||||||
|
pwi->dwExStyle = WindowObject->ExStyle;
|
||||||
|
pwi->dwWindowStatus = (NtUserGetForegroundWindow() == WindowObject->Self); /* WS_ACTIVECAPTION */
|
||||||
|
IntGetWindowBorderMeasures(WindowObject, &pwi->cxWindowBorders, &pwi->cyWindowBorders);
|
||||||
|
pwi->atomWindowType = (WindowObject->Class ? WindowObject->Class->Atom : 0);
|
||||||
|
pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static BOOL FASTCALL
|
static BOOL FASTCALL
|
||||||
IntSetMenu(
|
IntSetMenu(
|
||||||
PWINDOW_OBJECT WindowObject,
|
PWINDOW_OBJECT WindowObject,
|
||||||
|
|
|
@ -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: winpos.c,v 1.107 2004/04/01 23:16:21 gvg Exp $
|
/* $Id: winpos.c,v 1.108 2004/04/02 20:51:08 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -66,17 +66,6 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
#define HAS_DLGFRAME(Style, ExStyle) \
|
|
||||||
(((ExStyle) & WS_EX_DLGMODALFRAME) || \
|
|
||||||
(((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
|
|
||||||
|
|
||||||
#define HAS_THICKFRAME(Style, ExStyle) \
|
|
||||||
(((Style) & WS_THICKFRAME) && \
|
|
||||||
(!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
|
|
||||||
|
|
||||||
#define HAS_THINFRAME(Style, ExStyle) \
|
|
||||||
(((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
|
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntGetClientOrigin(HWND hWnd, LPPOINT Point)
|
IntGetClientOrigin(HWND hWnd, LPPOINT Point)
|
||||||
{
|
{
|
||||||
|
@ -223,25 +212,7 @@ WinPosInitInternalPos(PWINDOW_OBJECT WindowObject, POINT *pt, PRECT RestoreRect)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
WindowObject->InternalPos->NormalRect = WindowObject->WindowRect;
|
WindowObject->InternalPos->NormalRect = WindowObject->WindowRect;
|
||||||
if (HAS_DLGFRAME(WindowObject->Style, WindowObject->ExStyle) && !(WindowObject->Style & WS_MINIMIZE))
|
IntGetWindowBorderMeasures(WindowObject, &XInc, &YInc);
|
||||||
{
|
|
||||||
XInc = NtUserGetSystemMetrics(SM_CXDLGFRAME);
|
|
||||||
YInc = NtUserGetSystemMetrics(SM_CYDLGFRAME);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
XInc = YInc = 0;
|
|
||||||
if (HAS_THICKFRAME(WindowObject->Style, WindowObject->ExStyle)&& !(WindowObject->Style & WS_MINIMIZE))
|
|
||||||
{
|
|
||||||
XInc += NtUserGetSystemMetrics(SM_CXFRAME);
|
|
||||||
YInc += NtUserGetSystemMetrics(SM_CYFRAME);
|
|
||||||
}
|
|
||||||
else if (HAS_THINFRAME(WindowObject->Style, WindowObject->ExStyle))
|
|
||||||
{
|
|
||||||
XInc += NtUserGetSystemMetrics(SM_CXBORDER);
|
|
||||||
YInc += NtUserGetSystemMetrics(SM_CYBORDER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
WindowObject->InternalPos->MaxPos.x = WorkArea.left - XInc;
|
WindowObject->InternalPos->MaxPos.x = WorkArea.left - XInc;
|
||||||
WindowObject->InternalPos->MaxPos.y = WorkArea.top - YInc;
|
WindowObject->InternalPos->MaxPos.y = WorkArea.top - YInc;
|
||||||
WindowObject->InternalPos->IconPos.x = WorkArea.left;
|
WindowObject->InternalPos->IconPos.x = WorkArea.left;
|
||||||
|
@ -385,25 +356,7 @@ WinPosFillMinMaxInfoStruct(PWINDOW_OBJECT Window, MINMAXINFO *Info)
|
||||||
Info->ptMaxTrackSize.x = Info->ptMaxSize.x;
|
Info->ptMaxTrackSize.x = Info->ptMaxSize.x;
|
||||||
Info->ptMaxTrackSize.y = Info->ptMaxSize.y;
|
Info->ptMaxTrackSize.y = Info->ptMaxSize.y;
|
||||||
|
|
||||||
if (HAS_DLGFRAME(Window->Style, Window->ExStyle))
|
IntGetWindowBorderMeasures(Window, &XInc, &YInc);
|
||||||
{
|
|
||||||
XInc = NtUserGetSystemMetrics(SM_CXDLGFRAME);
|
|
||||||
YInc = NtUserGetSystemMetrics(SM_CYDLGFRAME);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
XInc = YInc = 0;
|
|
||||||
if (HAS_THICKFRAME(Window->Style, Window->ExStyle))
|
|
||||||
{
|
|
||||||
XInc += NtUserGetSystemMetrics(SM_CXFRAME);
|
|
||||||
YInc += NtUserGetSystemMetrics(SM_CYFRAME);
|
|
||||||
}
|
|
||||||
else if (HAS_THINFRAME(Window->Style, Window->ExStyle))
|
|
||||||
{
|
|
||||||
XInc += NtUserGetSystemMetrics(SM_CXBORDER);
|
|
||||||
YInc += NtUserGetSystemMetrics(SM_CYBORDER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Info->ptMaxSize.x += 2 * XInc;
|
Info->ptMaxSize.x += 2 * XInc;
|
||||||
Info->ptMaxSize.y += 2 * YInc;
|
Info->ptMaxSize.y += 2 * YInc;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue