- [Win32k] Update window structure.

svn path=/trunk/; revision=42108
This commit is contained in:
James Tabor 2009-07-20 23:18:16 +00:00
parent 04dbe9d46f
commit 928ed84e9f
25 changed files with 689 additions and 587 deletions

View file

@ -202,7 +202,7 @@ GetClassLongA(HWND hWnd, int nIndex)
_SEH2_TRY _SEH2_TRY
{ {
Class = DesktopPtrToUser(Wnd->Class); Class = DesktopPtrToUser(Wnd->pcls);
if (Class != NULL) if (Class != NULL)
{ {
if (nIndex >= 0) if (nIndex >= 0)
@ -315,7 +315,7 @@ GetClassLongW ( HWND hWnd, int nIndex )
_SEH2_TRY _SEH2_TRY
{ {
Class = DesktopPtrToUser(Wnd->Class); Class = DesktopPtrToUser(Wnd->pcls);
if (Class != NULL) if (Class != NULL)
{ {
if (nIndex >= 0) if (nIndex >= 0)
@ -504,7 +504,7 @@ GetWindowLongA ( HWND hWnd, int nIndex )
if (nIndex >= 0) if (nIndex >= 0)
{ {
if ((DWORD)nIndex + sizeof(LONG) > Wnd->ExtraDataSize) if ((DWORD)nIndex + sizeof(LONG) > Wnd->cbwndExtra)
{ {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
return 0; return 0;
@ -519,13 +519,13 @@ GetWindowLongA ( HWND hWnd, int nIndex )
case GWL_EXSTYLE: case GWL_EXSTYLE:
return Wnd->ExStyle; return Wnd->ExStyle;
case GWL_STYLE: case GWL_STYLE:
return Wnd->Style; return Wnd->style;
case GWL_HINSTANCE: case GWL_HINSTANCE:
return (LONG)Wnd->Instance; return (LONG)Wnd->hModule;
case GWL_ID: case GWL_ID:
return Wnd->IDMenu; return Wnd->IDMenu;
case GWL_USERDATA: case GWL_USERDATA:
return Wnd->UserData; return Wnd->dwUserData;
case GWL_HWNDPARENT: case GWL_HWNDPARENT:
{ {
@ -561,7 +561,7 @@ GetWindowLongW(HWND hWnd, int nIndex)
if (nIndex >= 0) if (nIndex >= 0)
{ {
if ((DWORD)nIndex + sizeof(LONG) > Wnd->ExtraDataSize) if ((DWORD)nIndex + sizeof(LONG) > Wnd->cbwndExtra)
{ {
SetLastError(ERROR_INVALID_PARAMETER); SetLastError(ERROR_INVALID_PARAMETER);
return 0; return 0;
@ -576,13 +576,13 @@ GetWindowLongW(HWND hWnd, int nIndex)
case GWL_EXSTYLE: case GWL_EXSTYLE:
return Wnd->ExStyle; return Wnd->ExStyle;
case GWL_STYLE: case GWL_STYLE:
return Wnd->Style; return Wnd->style;
case GWL_HINSTANCE: case GWL_HINSTANCE:
return (LONG)Wnd->Instance; return (LONG)Wnd->hModule;
case GWL_ID: case GWL_ID:
return Wnd->IDMenu; return Wnd->IDMenu;
case GWL_USERDATA: case GWL_USERDATA:
return Wnd->UserData; return Wnd->dwUserData;
case GWL_HWNDPARENT: case GWL_HWNDPARENT:
{ {

View file

@ -120,12 +120,12 @@ UserGetInsideRectNC(PWINDOW Wnd, RECT *rect)
ULONG Style; ULONG Style;
ULONG ExStyle; ULONG ExStyle;
Style = Wnd->Style; Style = Wnd->style;
ExStyle = Wnd->ExStyle; ExStyle = Wnd->ExStyle;
rect->top = rect->left = 0; rect->top = rect->left = 0;
rect->right = Wnd->WindowRect.right - Wnd->WindowRect.left; rect->right = Wnd->rcWindow.right - Wnd->rcWindow.left;
rect->bottom = Wnd->WindowRect.bottom - Wnd->WindowRect.top; rect->bottom = Wnd->rcWindow.bottom - Wnd->rcWindow.top;
if (Style & WS_ICONIC) if (Style & WS_ICONIC)
{ {
@ -268,9 +268,9 @@ DefWndStartSizeMove(HWND hWnd, PWINDOW Wnd, WPARAM wParam, POINT *capturePoint)
POINT pt; POINT pt;
MSG msg; MSG msg;
RECT rectWindow; RECT rectWindow;
ULONG Style = Wnd->Style; ULONG Style = Wnd->style;
rectWindow = Wnd->WindowRect; rectWindow = Wnd->rcWindow;
if ((wParam & 0xfff0) == SC_MOVE) if ((wParam & 0xfff0) == SC_MOVE)
{ {
@ -415,7 +415,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
if (!Wnd) if (!Wnd)
return; return;
Style = Wnd->Style; Style = Wnd->style;
ExStyle = Wnd->ExStyle; ExStyle = Wnd->ExStyle;
iconic = (Style & WS_MINIMIZE) != 0; iconic = (Style & WS_MINIMIZE) != 0;
@ -467,7 +467,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
/* Get min/max info */ /* Get min/max info */
WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack); WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack);
sizingRect = Wnd->WindowRect; sizingRect = Wnd->rcWindow;
if (Style & WS_CHILD) if (Style & WS_CHILD)
{ {
hWndParent = GetParent(hwnd); hWndParent = GetParent(hwnd);
@ -1690,11 +1690,11 @@ User32DefWindowProc(HWND hWnd,
break; break;
} }
if ((Wnd->Style & WS_CHILD) && Wnd->Parent != NULL) if ((Wnd->style & WS_CHILD) && Wnd->spwndParent != NULL)
{ {
/* We're a child window and we need to pass this message down until /* We're a child window and we need to pass this message down until
we reach the root */ we reach the root */
hWnd = UserHMGetHandle((PWINDOW)DesktopPtrToUser(Wnd->Parent)); hWnd = UserHMGetHandle((PWINDOW)DesktopPtrToUser(Wnd->spwndParent));
} }
else else
{ {
@ -1893,13 +1893,13 @@ DefWindowProcA(HWND hWnd,
ULONG len; ULONG len;
Wnd = ValidateHwnd(hWnd); Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL && Wnd->WindowName.Length != 0) if (Wnd != NULL && Wnd->strName.Length != 0)
{ {
buf = DesktopPtrToUser(Wnd->WindowName.Buffer); buf = DesktopPtrToUser(Wnd->strName.Buffer);
if (buf != NULL && if (buf != NULL &&
NT_SUCCESS(RtlUnicodeToMultiByteSize(&len, NT_SUCCESS(RtlUnicodeToMultiByteSize(&len,
buf, buf,
Wnd->WindowName.Length))) Wnd->strName.Length)))
{ {
Result = (LRESULT) len; Result = (LRESULT) len;
} }
@ -1918,16 +1918,16 @@ DefWindowProcA(HWND hWnd,
Wnd = ValidateHwnd(hWnd); Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL && wParam != 0) if (Wnd != NULL && wParam != 0)
{ {
if (Wnd->WindowName.Buffer != NULL) if (Wnd->strName.Buffer != NULL)
buf = DesktopPtrToUser(Wnd->WindowName.Buffer); buf = DesktopPtrToUser(Wnd->strName.Buffer);
else else
outbuf[0] = L'\0'; outbuf[0] = L'\0';
if (buf != NULL) if (buf != NULL)
{ {
if (Wnd->WindowName.Length != 0) if (Wnd->strName.Length != 0)
{ {
copy = min(Wnd->WindowName.Length / sizeof(WCHAR), wParam - 1); copy = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
Result = WideCharToMultiByte(CP_ACP, Result = WideCharToMultiByte(CP_ACP,
0, 0,
buf, buf,
@ -2041,15 +2041,15 @@ DefWindowProcW(HWND hWnd,
ULONG len; ULONG len;
Wnd = ValidateHwnd(hWnd); Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL && Wnd->WindowName.Length != 0) if (Wnd != NULL && Wnd->strName.Length != 0)
{ {
buf = DesktopPtrToUser(Wnd->WindowName.Buffer); buf = DesktopPtrToUser(Wnd->strName.Buffer);
if (buf != NULL && if (buf != NULL &&
NT_SUCCESS(RtlUnicodeToMultiByteSize(&len, NT_SUCCESS(RtlUnicodeToMultiByteSize(&len,
buf, buf,
Wnd->WindowName.Length))) Wnd->strName.Length)))
{ {
Result = (LRESULT) (Wnd->WindowName.Length / sizeof(WCHAR)); Result = (LRESULT) (Wnd->strName.Length / sizeof(WCHAR));
} }
} }
else Result = 0L; else Result = 0L;
@ -2065,16 +2065,16 @@ DefWindowProcW(HWND hWnd,
Wnd = ValidateHwnd(hWnd); Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL && wParam != 0) if (Wnd != NULL && wParam != 0)
{ {
if (Wnd->WindowName.Buffer != NULL) if (Wnd->strName.Buffer != NULL)
buf = DesktopPtrToUser(Wnd->WindowName.Buffer); buf = DesktopPtrToUser(Wnd->strName.Buffer);
else else
outbuf[0] = L'\0'; outbuf[0] = L'\0';
if (buf != NULL) if (buf != NULL)
{ {
if (Wnd->WindowName.Length != 0) if (Wnd->strName.Length != 0)
{ {
Result = min(Wnd->WindowName.Length / sizeof(WCHAR), wParam - 1); Result = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
RtlCopyMemory(outbuf, RtlCopyMemory(outbuf,
buf, buf,
Result * sizeof(WCHAR)); Result * sizeof(WCHAR));

View file

@ -153,7 +153,7 @@ DIALOGINFO * DIALOG_get_info( HWND hWnd, BOOL create )
{ {
pWindow = ValidateHwnd( hWnd ); pWindow = ValidateHwnd( hWnd );
if (pWindow && pWindow->ExtraDataSize >= DLGWINDOWEXTRA && hWnd != GetDesktopWindow()) if (pWindow && pWindow->cbwndExtra >= DLGWINDOWEXTRA && hWnd != GetDesktopWindow())
{ {
if (!(dlgInfo = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dlgInfo) ))) if (!(dlgInfo = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dlgInfo) )))
return NULL; return NULL;

View file

@ -573,7 +573,7 @@ MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND WndOwner, HDC Dc,
if (0 != (Item->fType & MF_SYSMENU)) if (0 != (Item->fType & MF_SYSMENU))
{ {
if ( (Wnd->Style & WS_MINIMIZE)) if ( (Wnd->style & WS_MINIMIZE))
{ {
UserGetInsideRectNC(Wnd, &Rect); UserGetInsideRectNC(Wnd, &Rect);
UserDrawSysMenuButton(hWnd, Dc, &Rect, UserDrawSysMenuButton(hWnd, Dc, &Rect,

View file

@ -1311,12 +1311,12 @@ IntCallMessageProc(IN PWINDOW Wnd, IN HWND hWnd, IN UINT Msg, IN WPARAM wParam,
if (Wnd->IsSystem) if (Wnd->IsSystem)
{ {
WndProc = (Ansi ? Wnd->WndProcExtra : Wnd->WndProc); WndProc = (Ansi ? Wnd->WndProcExtra : Wnd->lpfnWndProc);
IsAnsi = Ansi; IsAnsi = Ansi;
} }
else else
{ {
WndProc = Wnd->WndProc; WndProc = Wnd->lpfnWndProc;
IsAnsi = !Wnd->Unicode; IsAnsi = !Wnd->Unicode;
} }
@ -1361,7 +1361,7 @@ DispatchMessageA(CONST MSG *lpmsg)
else if (Wnd != NULL) else if (Wnd != NULL)
{ {
// FIXME Need to test for calling proc inside win32k! // FIXME Need to test for calling proc inside win32k!
if ( (lpmsg->message != WM_PAINT) ) // && !(Wnd->flags & WNDF_CALLPROC) ) if ( (lpmsg->message != WM_PAINT) ) // && !(Wnd->state & WNDS_SERVERSIDEWINDOWPROC) )
{ {
Ret = IntCallMessageProc(Wnd, Ret = IntCallMessageProc(Wnd,
lpmsg->hwnd, lpmsg->hwnd,
@ -1422,7 +1422,7 @@ DispatchMessageW(CONST MSG *lpmsg)
else if (Wnd != NULL) else if (Wnd != NULL)
{ {
// FIXME Need to test for calling proc inside win32k! // FIXME Need to test for calling proc inside win32k!
if ( (lpmsg->message != WM_PAINT) ) // && !(Wnd->flags & W32K_CALLPROC) ) if ( (lpmsg->message != WM_PAINT) ) // && !(Wnd->state & WNDS_SERVERSIDEWINDOWPROC) )
{ {
Ret = IntCallMessageProc(Wnd, Ret = IntCallMessageProc(Wnd,
lpmsg->hwnd, lpmsg->hwnd,

View file

@ -850,8 +850,8 @@ GetAncestor(HWND hwnd, UINT gaFlags)
switch (gaFlags) switch (gaFlags)
{ {
case GA_PARENT: case GA_PARENT:
if (Wnd->Parent != NULL) if (Wnd->spwndParent != NULL)
Ancestor = DesktopPtrToUser(Wnd->Parent); Ancestor = DesktopPtrToUser(Wnd->spwndParent);
break; break;
default: default:
@ -887,8 +887,8 @@ GetClientRect(HWND hWnd, LPRECT lpRect)
if (Wnd != NULL) if (Wnd != NULL)
{ {
lpRect->left = lpRect->top = 0; lpRect->left = lpRect->top = 0;
lpRect->right = Wnd->ClientRect.right - Wnd->ClientRect.left; lpRect->right = Wnd->rcClient.right - Wnd->rcClient.left;
lpRect->bottom = Wnd->ClientRect.bottom - Wnd->ClientRect.top; lpRect->bottom = Wnd->rcClient.bottom - Wnd->rcClient.top;
return TRUE; return TRUE;
} }
@ -938,15 +938,15 @@ GetParent(HWND hWnd)
_SEH2_TRY _SEH2_TRY
{ {
WndParent = NULL; WndParent = NULL;
if (Wnd->Style & WS_CHILD) if (Wnd->style & WS_CHILD)
{ {
if (Wnd->Parent != NULL) if (Wnd->spwndParent != NULL)
WndParent = DesktopPtrToUser(Wnd->Parent); WndParent = DesktopPtrToUser(Wnd->spwndParent);
} }
else if (Wnd->Style & WS_POPUP) else if (Wnd->style & WS_POPUP)
{ {
if (Wnd->Owner != NULL) if (Wnd->spwndOwner != NULL)
WndParent = DesktopPtrToUser(Wnd->Owner); WndParent = DesktopPtrToUser(Wnd->spwndOwner);
} }
if (WndParent != NULL) if (WndParent != NULL)
@ -1002,8 +1002,8 @@ GetWindow(HWND hWnd,
switch (uCmd) switch (uCmd)
{ {
case GW_OWNER: case GW_OWNER:
if (Wnd->Owner != NULL) if (Wnd->spwndOwner != NULL)
FoundWnd = DesktopPtrToUser(Wnd->Owner); FoundWnd = DesktopPtrToUser(Wnd->spwndOwner);
break; break;
default: default:
@ -1099,7 +1099,7 @@ GetWindowRect(HWND hWnd,
if (Wnd != NULL) if (Wnd != NULL)
{ {
*lpRect = Wnd->WindowRect; *lpRect = Wnd->rcWindow;
return TRUE; return TRUE;
} }
@ -1131,10 +1131,10 @@ GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
if (nMaxCount > 0) if (nMaxCount > 0)
{ {
/* do not send WM_GETTEXT messages to other processes */ /* do not send WM_GETTEXT messages to other processes */
Length = Wnd->WindowName.Length / sizeof(WCHAR); Length = Wnd->strName.Length / sizeof(WCHAR);
if (Length != 0) if (Length != 0)
{ {
Buffer = DesktopPtrToUser(Wnd->WindowName.Buffer); Buffer = DesktopPtrToUser(Wnd->strName.Buffer);
if (Buffer != NULL) if (Buffer != NULL)
{ {
if (!WideCharToMultiByte(CP_ACP, if (!WideCharToMultiByte(CP_ACP,
@ -1221,10 +1221,10 @@ GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
if (nMaxCount > 0) if (nMaxCount > 0)
{ {
/* do not send WM_GETTEXT messages to other processes */ /* do not send WM_GETTEXT messages to other processes */
Length = Wnd->WindowName.Length / sizeof(WCHAR); Length = Wnd->strName.Length / sizeof(WCHAR);
if (Length != 0) if (Length != 0)
{ {
Buffer = DesktopPtrToUser(Wnd->WindowName.Buffer); Buffer = DesktopPtrToUser(Wnd->strName.Buffer);
if (Buffer != NULL) if (Buffer != NULL)
{ {
RtlCopyMemory(lpString, RtlCopyMemory(lpString,
@ -1312,9 +1312,9 @@ IsChild(HWND hWndParent,
{ {
while (Wnd != NULL) while (Wnd != NULL)
{ {
if (Wnd->Parent != NULL) if (Wnd->spwndParent != NULL)
{ {
Wnd = DesktopPtrToUser(Wnd->Parent); Wnd = DesktopPtrToUser(Wnd->spwndParent);
if (Wnd == WndParent) if (Wnd == WndParent)
{ {
Ret = TRUE; Ret = TRUE;
@ -1344,7 +1344,7 @@ IsIconic(HWND hWnd)
PWINDOW Wnd = ValidateHwnd(hWnd); PWINDOW Wnd = ValidateHwnd(hWnd);
if (Wnd != NULL) if (Wnd != NULL)
return (Wnd->Style & WS_MINIMIZE) != 0; return (Wnd->style & WS_MINIMIZE) != 0;
return FALSE; return FALSE;
} }
@ -1399,14 +1399,14 @@ IsWindowVisible(HWND hWnd)
do do
{ {
if (!(Wnd->Style & WS_VISIBLE)) if (!(Wnd->style & WS_VISIBLE))
{ {
Ret = FALSE; Ret = FALSE;
break; break;
} }
if (Wnd->Parent != NULL) if (Wnd->spwndParent != NULL)
Wnd = DesktopPtrToUser(Wnd->Parent); Wnd = DesktopPtrToUser(Wnd->spwndParent);
else else
break; break;
@ -1690,8 +1690,8 @@ MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
if (!ToWnd) if (!ToWnd)
return 0; return 0;
Delta.x = FromWnd->ClientRect.left - ToWnd->ClientRect.left; Delta.x = FromWnd->rcClient.left - ToWnd->rcClient.left;
Delta.y = FromWnd->ClientRect.top - ToWnd->ClientRect.top; Delta.y = FromWnd->rcClient.top - ToWnd->rcClient.top;
for (i = 0; i != cPoints; i++) for (i = 0; i != cPoints; i++)
{ {
@ -1717,8 +1717,8 @@ ScreenToClient(HWND hWnd, LPPOINT lpPoint)
DesktopWnd = GetThreadDesktopWnd(); DesktopWnd = GetThreadDesktopWnd();
lpPoint->x += DesktopWnd->ClientRect.left - Wnd->ClientRect.left; lpPoint->x += DesktopWnd->rcClient.left - Wnd->rcClient.left;
lpPoint->y += DesktopWnd->ClientRect.top - Wnd->ClientRect.top; lpPoint->y += DesktopWnd->rcClient.top - Wnd->rcClient.top;
return TRUE; return TRUE;
} }
@ -1738,8 +1738,8 @@ ClientToScreen(HWND hWnd, LPPOINT lpPoint)
DesktopWnd = GetThreadDesktopWnd(); DesktopWnd = GetThreadDesktopWnd();
lpPoint->x += Wnd->ClientRect.left - DesktopWnd->ClientRect.left; lpPoint->x += Wnd->rcClient.left - DesktopWnd->rcClient.left;
lpPoint->y += Wnd->ClientRect.top - DesktopWnd->ClientRect.top; lpPoint->y += Wnd->rcClient.top - DesktopWnd->rcClient.top;
return TRUE; return TRUE;
} }

View file

@ -137,13 +137,100 @@ typedef struct _WINDOWCLASS
} WINDOWCLASS, *PWINDOWCLASS; } WINDOWCLASS, *PWINDOWCLASS;
// Flags !Not Implemented! // State Flags !Not Implemented!
#define WNDF_CALLPROC 0x0004 // Call proc inside win32k. #define WNDS_HASMENU 0X00000001
#define WNDS_HASVERTICALSCROOLLBAR 0X00000002
#define WNDS_HASHORIZONTALSCROLLBAR 0X00000004
#define WNDS_HASCAPTION 0X00000008
#define WNDS_SENDSIZEMOVEMSGS 0X00000010
#define WNDS_MSGBOX 0X00000020
#define WNDS_ACTIVEFRAME 0X00000040
#define WNDS_HASSPB 0X00000080
#define WNDS_NONCPAINT 0X00000100
#define WNDS_SENDERASEBACKGROUND 0X00000200
#define WNDS_ERASEBACKGROUND 0X00000400
#define WNDS_SENDNCPAINT 0X00000800
#define WNDS_INTERNALPAINT 0X00001000
#define WNDS_UPDATEDIRTY 0X00002000
#define WNDS_HIDDENPOPUP 0X00004000
#define WNDS_FORCEMENUDRAW 0X00008000
#define WNDS_DIALOGWINDOW 0X00010000
#define WNDS_HASCREATESTRUCTNAME 0X00020000
#define WNDS_SERVERSIDEWINDOWPROC 0x00040000 // Call proc inside win32k.
#define WNDS_ANSIWINDOWPROC 0x00080000
#define WNDS_BEGINGACTIVATED 0x00100000
#define WNDS_HASPALETTE 0x00200000
#define WNDS_PAINTNOTPROCESSED 0x00400000
#define WNDS_SYNCPAINTPENDING 0x00800000
#define WNDS_RECIEVEDQUERYSUSPENDMSG 0x01000000
#define WNDS_RECIEVEDSUSPENDMSG 0x02000000
#define WNDS_TOGGLETOPMOST 0x04000000
#define WNDS_REDRAWIFHUNG 0x08000000
#define WNDS_REDRAWFRAMEIFHUNG 0x10000000
#define WNDS_ANSICREATOR 0x20000000
#define WNDS_MAXIMIZESTOMONITOR 0x40000000
#define WNDS_DESTROYED 0x80000000
// State2 Flags !Not Implemented!
#define WNDS2_WMPAINTSENT 0X00000001
#define WNDS2_ENDPAINTINVALIDATE 0X00000002
#define WNDS2_STARTPAINT 0X00000004
#define WNDS2_OLDUI 0X00000008
#define WNDS2_HASCLIENTEDGE 0X00000010
#define WNDS2_BOTTOMMOST 0X00000020
#define WNDS2_FULLSCREEN 0X00000040
#define WNDS2_INDESTROY 0X00000080
#define WNDS2_WIN31COMPAT 0X00000100
#define WNDS2_WIN40COMPAT 0X00000200
#define WNDS2_WIN50COMPAT 0X00000400
#define WNDS2_MAXIMIZEDMONITORREGION 0X00000800
#define WNDS2_CLOSEBUTTONDOWN 0X00001000
#define WNDS2_MAXIMIZEBUTTONDOWN 0X00002000
#define WNDS2_MINIMIZEBUTTONDOWN 0X00004000
#define WNDS2_HELPBUTTONDOWN 0X00008000
#define WNDS2_SCROLLBARLINEUPBTNDOWN 0X00010000
#define WNDS2_SCROLLBARPAGEUPBTNDOWN 0X00020000
#define WNDS2_SCROLLBARPAGEDOWNBTNDOWN 0X00040000
#define WNDS2_SCROLLBARLINEDOWNBTNDOWN 0X00080000
#define WNDS2_ANYSCROLLBUTTONDOWN 0X00100000
#define WNDS2_SCROLLBARVERTICALTRACKING 0X00200000
#define WNDS2_FORCENCPAINT 0X00400000
#define WNDS2_FORCEFULLNCPAINTCLIPRGN 0X00800000
#define WNDS2_FULLSCREENMODE 0X01000000
#define WNDS2_CAPTIONTEXTTRUNCATED 0X08000000
#define WNDS2_NOMINMAXANIMATERECTS 0X10000000
#define WNDS2_SMALLICONFROMWMQUERYDRAG 0X20000000
#define WNDS2_SHELLHOOKREGISTERED 0X40000000
#define WNDS2_WMCREATEMSGPROCESSED 0X80000000
/* Non SDK ExStyles */
#define WS_EX_MAKEVISIBLEWHENUNGHOSTED 0x00000800
#define WS_EX_UISTATEACTIVE 0x04000000
#define WS_EX_REDIRECTED 0X20000000
#define WS_EX_UISTATEKBACCELHIDDEN 0X40000000
#define WS_EX_UISTATEFOCUSRECTHIDDEN 0X80000000
/* Non SDK Styles */
#define WS_MAXIMIZED 0X01000000
#define WS_MINIMIZED 0X20000000
/* ExStyles2 */
#define WS_EX2_CLIPBOARDLISTENER 0X00000001
#define WS_EX2_LAYEREDINVALIDATE 0X00000002
#define WS_EX2_REDIRECTEDFORPRINT 0X00000004
#define WS_EX2_LINKED 0X00000008
#define WS_EX2_LAYEREDFORDWM 0X00000010
#define WS_EX2_LAYEREDLIMBO 0X00000020
#define WS_EX2_HIGHTDPI_UNAWAR 0X00000040
#define WS_EX2_VERTICALLYMAXIMIZEDLEFT 0X00000080
#define WS_EX2_VERTICALLYMAXIMIZEDRIGHT 0X00000100
#define WS_EX2_HASOVERLAY 0X00000200
#define WS_EX2_CONSOLEWINDOW 0X00000400
#define WS_EX2_CHILDNOACTIVATE 0X00000800
typedef struct _WINDOW typedef struct _WINDOW
{ {
USER_OBJHDR hdr; /* FIXME: Move out of the structure once new handle manager is implemented */ USER_OBJHDR hdr; /* FIXME: Move out of the structure once new handle manager is implemented */
/* NOTE: This structure is located in the desktop heap and will /* NOTE: This structure is located in the desktop heap and will
eventually replace WINDOW_OBJECT. Right now WINDOW_OBJECT eventually replace WINDOW_OBJECT. Right now WINDOW_OBJECT
keeps a reference to this structure until all the information keeps a reference to this structure until all the information
@ -151,10 +238,24 @@ typedef struct _WINDOW
struct _PROCESSINFO *pi; /* FIXME: Move to object header some day */ struct _PROCESSINFO *pi; /* FIXME: Move to object header some day */
struct _W32THREADINFO *ti; struct _W32THREADINFO *ti;
struct _DESKTOP *pdesktop; struct _DESKTOP *pdesktop;
RECT WindowRect;
RECT ClientRect;
WNDPROC WndProc; DWORD state;
DWORD state2;
/* Extended style. */
DWORD ExStyle;
/* Style. */
DWORD style;
/* Handle of the module that created the window. */
HINSTANCE hModule;
DWORD fnid;
struct _WINDOW *spwndNext;
struct _WINDOW *spwndPrev;
struct _WINDOW *spwndParent;
struct _WINDOW *spwndChild;
struct _WINDOW *spwndOwner;
RECT rcWindow;
RECT rcClient;
WNDPROC lpfnWndProc;
union union
{ {
/* Pointer to a call procedure handle */ /* Pointer to a call procedure handle */
@ -163,31 +264,32 @@ typedef struct _WINDOW
WNDPROC WndProcExtra; WNDPROC WndProcExtra;
}; };
struct _WINDOW *Parent;
struct _WINDOW *Owner;
/* Size of the extra data associated with the window. */
ULONG ExtraDataSize;
/* Style. */
DWORD Style;
/* Extended style. */
DWORD ExStyle;
/* Handle of the module that created the window. */
HINSTANCE Instance;
/* Window menu handle or window id */
UINT IDMenu;
LONG UserData;
/* Pointer to the window class. */ /* Pointer to the window class. */
PWINDOWCLASS Class; PWINDOWCLASS pcls;
/* Window name. */ HRGN hrgnUpdate;
UNICODE_STRING WindowName;
/* Context help id */
DWORD ContextHelpId;
HWND hWndLastActive;
/* Property list head.*/ /* Property list head.*/
LIST_ENTRY PropListHead; LIST_ENTRY PropListHead;
ULONG PropListItems; ULONG PropListItems;
/* Window menu handle or window id */
UINT IDMenu;
//PMENU spmenuSys;
//PMENU spmenu;
HRGN hrgnClip;
/* Window name. */
UNICODE_STRING strName;
/* Size of the extra data associated with the window. */
ULONG cbwndExtra;
HWND hWndLastActive;
struct _WINDOW *spwndLastActive;
//HIMC hImc; // Input context associated with this window.
LONG dwUserData;
//PACTIVATION_CONTEXT pActCtx;
//PD3DMATRIX pTransForm;
struct _WINDOW *spwndClipboardListener;
DWORD ExStyle2;
/* Context help id */
DWORD ContextHelpId;
struct struct
{ {
@ -196,12 +298,12 @@ typedef struct _WINDOW
POINT MaxPos; POINT MaxPos;
} InternalPos; } InternalPos;
UINT Unicode : 1; UINT Unicode : 1; // !WNDS_ANSICREATOR ?
/* Indicates whether the window is derived from a system class */ /* Indicates whether the window is derived from a system class */
UINT IsSystem : 1; UINT IsSystem : 1; // System class ?
UINT InternalPosInitialized : 1; UINT InternalPosInitialized : 1;
UINT HideFocus : 1; UINT HideFocus : 1; // WS_EX_UISTATEFOCUSRECTHIDDEN ?
UINT HideAccel : 1; UINT HideAccel : 1; // WS_EX_UISTATEKBACCELHIDDEN ?
} WINDOW, *PWINDOW; } WINDOW, *PWINDOW;
typedef struct _PFNCLIENT typedef struct _PFNCLIENT

View file

@ -88,7 +88,7 @@ IntEngWndUpdateClipObj(
hVisRgn = VIS_ComputeVisibleRegion(Window, TRUE, TRUE, TRUE); hVisRgn = VIS_ComputeVisibleRegion(Window, TRUE, TRUE, TRUE);
if (hVisRgn != NULL) if (hVisRgn != NULL)
{ {
NtGdiOffsetRgn(hVisRgn, Window->Wnd->ClientRect.left, Window->Wnd->ClientRect.top); NtGdiOffsetRgn(hVisRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
visRgn = REGION_LockRgn(hVisRgn); visRgn = REGION_LockRgn(hVisRgn);
if (visRgn != NULL) if (visRgn != NULL)
{ {
@ -125,8 +125,8 @@ IntEngWndUpdateClipObj(
if (ClipObj == NULL) if (ClipObj == NULL)
{ {
/* Fall back to client rect */ /* Fall back to client rect */
ClipObj = IntEngCreateClipRegion(1, &Window->Wnd->ClientRect, ClipObj = IntEngCreateClipRegion(1, &Window->Wnd->rcClient,
&Window->Wnd->ClientRect); &Window->Wnd->rcClient);
} }
if (ClipObj == NULL) if (ClipObj == NULL)
@ -136,7 +136,7 @@ IntEngWndUpdateClipObj(
} }
RtlCopyMemory(&WndObjInt->WndObj.coClient, ClipObj, sizeof (CLIPOBJ)); RtlCopyMemory(&WndObjInt->WndObj.coClient, ClipObj, sizeof (CLIPOBJ));
RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->ClientRect, sizeof (RECT)); RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->rcClient, sizeof (RECT));
OldClipObj = InterlockedExchangePointer(&WndObjInt->ClientClipObj, ClipObj); OldClipObj = InterlockedExchangePointer(&WndObjInt->ClientClipObj, ClipObj);
if (OldClipObj != NULL) if (OldClipObj != NULL)
IntEngDeleteClipRegion(OldClipObj); IntEngDeleteClipRegion(OldClipObj);

View file

@ -8,13 +8,13 @@
#define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000140) #define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000140)
#define IntPtInWindow(WndObject,x,y) \ #define IntPtInWindow(WndObject,x,y) \
((x) >= (WndObject)->Wnd->WindowRect.left && \ ((x) >= (WndObject)->Wnd->rcWindow.left && \
(x) < (WndObject)->Wnd->WindowRect.right && \ (x) < (WndObject)->Wnd->rcWindow.right && \
(y) >= (WndObject)->Wnd->WindowRect.top && \ (y) >= (WndObject)->Wnd->rcWindow.top && \
(y) < (WndObject)->Wnd->WindowRect.bottom && \ (y) < (WndObject)->Wnd->rcWindow.bottom && \
(!(WndObject)->WindowRegion || ((WndObject)->Wnd->Style & WS_MINIMIZE) || \ (!(WndObject)->WindowRegion || ((WndObject)->Wnd->style & WS_MINIMIZE) || \
NtGdiPtInRegion((WndObject)->WindowRegion, (INT)((x) - (WndObject)->Wnd->WindowRect.left), \ NtGdiPtInRegion((WndObject)->WindowRegion, (INT)((x) - (WndObject)->Wnd->rcWindow.left), \
(INT)((y) - (WndObject)->Wnd->WindowRect.top)))) (INT)((y) - (WndObject)->Wnd->rcWindow.top))))
UINT UINT
FASTCALL co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent); FASTCALL co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent);

View file

@ -2169,11 +2169,11 @@ NtUserGetClassLong(IN HWND hWnd,
Window = UserGetWindowObject(hWnd); Window = UserGetWindowObject(hWnd);
if (Window != NULL) if (Window != NULL)
{ {
Ret = UserGetClassLongPtr(Window->Wnd->Class, Ret = UserGetClassLongPtr(Window->Wnd->pcls,
Offset, Offset,
Ansi); Ansi);
if (Ret != 0 && Offset == GCLP_MENUNAME && Window->Wnd->Class->MenuNameIsString) if (Ret != 0 && Offset == GCLP_MENUNAME && Window->Wnd->pcls->MenuNameIsString)
{ {
Ret = (ULONG_PTR)UserHeapAddressToUser((PVOID)Ret); Ret = (ULONG_PTR)UserHeapAddressToUser((PVOID)Ret);
} }
@ -2247,7 +2247,7 @@ InvalidParameter:
dwNewLong = (ULONG_PTR)&Value; dwNewLong = (ULONG_PTR)&Value;
} }
Ret = UserSetClassLongPtr(Window->Wnd->Class, Ret = UserSetClassLongPtr(Window->Wnd->pcls,
Offset, Offset,
dwNewLong, dwNewLong,
Ansi); Ansi);
@ -2458,7 +2458,7 @@ NtUserGetClassName (IN HWND hWnd,
CapturedClassName = *ClassName; CapturedClassName = *ClassName;
/* get the class name */ /* get the class name */
Ret = UserGetClassName(Window->Wnd->Class, Ret = UserGetClassName(Window->Wnd->pcls,
&CapturedClassName, &CapturedClassName,
Ansi); Ansi);

View file

@ -863,10 +863,10 @@ NtUserClipCursor(
MOUSEINPUT mi; MOUSEINPUT mi;
CurInfo->CursorClipInfo.IsClipped = TRUE; CurInfo->CursorClipInfo.IsClipped = TRUE;
CurInfo->CursorClipInfo.Left = max(Rect.left, DesktopWindow->Wnd->WindowRect.left); CurInfo->CursorClipInfo.Left = max(Rect.left, DesktopWindow->Wnd->rcWindow.left);
CurInfo->CursorClipInfo.Top = max(Rect.top, DesktopWindow->Wnd->WindowRect.top); CurInfo->CursorClipInfo.Top = max(Rect.top, DesktopWindow->Wnd->rcWindow.top);
CurInfo->CursorClipInfo.Right = min(Rect.right - 1, DesktopWindow->Wnd->WindowRect.right - 1); CurInfo->CursorClipInfo.Right = min(Rect.right - 1, DesktopWindow->Wnd->rcWindow.right - 1);
CurInfo->CursorClipInfo.Bottom = min(Rect.bottom - 1, DesktopWindow->Wnd->WindowRect.bottom - 1); CurInfo->CursorClipInfo.Bottom = min(Rect.bottom - 1, DesktopWindow->Wnd->rcWindow.bottom - 1);
mi.dx = MousePos.x; mi.dx = MousePos.x;
mi.dy = MousePos.y; mi.dy = MousePos.y;

View file

@ -127,8 +127,8 @@ IntDefWindowProc(
} }
case WM_SHOWWINDOW: case WM_SHOWWINDOW:
{ {
if ((Wnd->Style & WS_VISIBLE) && wParam) break; if ((Wnd->style & WS_VISIBLE) && wParam) break;
if (!(Wnd->Style & WS_VISIBLE) && !wParam) break; if (!(Wnd->style & WS_VISIBLE) && !wParam) break;
if (!Window->hOwner) break; if (!Window->hOwner) break;
if (LOWORD(lParam)) if (LOWORD(lParam))
{ {

View file

@ -694,7 +694,7 @@ IntHideDesktop(PDESKTOP Desktop)
return ERROR_INVALID_WINDOW_HANDLE; return ERROR_INVALID_WINDOW_HANDLE;
} }
DesktopWnd = DesktopWindow->Wnd; DesktopWnd = DesktopWindow->Wnd;
DesktopWnd->Style &= ~WS_VISIBLE; DesktopWnd->style &= ~WS_VISIBLE;
return STATUS_SUCCESS; return STATUS_SUCCESS;
#endif #endif
@ -1498,7 +1498,7 @@ NtUserPaintDesktop(HDC hDC)
RETURN(FALSE); RETURN(FALSE);
} }
DesktopBrush = (HBRUSH)UserGetClassLongPtr(WndDesktop->Wnd->Class, GCL_HBRBACKGROUND, FALSE); DesktopBrush = (HBRUSH)UserGetClassLongPtr(WndDesktop->Wnd->pcls, GCL_HBRBACKGROUND, FALSE);
/* /*
@ -1517,8 +1517,8 @@ NtUserPaintDesktop(HDC hDC)
int x, y; int x, y;
HDC hWallpaperDC; HDC hWallpaperDC;
sz.cx = DeskWin->Wnd->WindowRect.right - DeskWin->Wnd->WindowRect.left; sz.cx = DeskWin->Wnd->rcWindow.right - DeskWin->Wnd->rcWindow.left;
sz.cy = DeskWin->Wnd->WindowRect.bottom - DeskWin->Wnd->WindowRect.top; sz.cy = DeskWin->Wnd->rcWindow.bottom - DeskWin->Wnd->rcWindow.top;
if (WinSta->WallpaperMode == wmStretch || if (WinSta->WallpaperMode == wmStretch ||
WinSta->WallpaperMode == wmTile) WinSta->WallpaperMode == wmTile)

View file

@ -93,8 +93,8 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
if (Window->Wnd) if (Window->Wnd)
{ // Set last active for window and it's owner. { // Set last active for window and it's owner.
Window->Wnd->hWndLastActive = hWnd; Window->Wnd->hWndLastActive = hWnd;
if (Window->Wnd->Owner) if (Window->Wnd->spwndOwner)
Window->Wnd->Owner->hWndLastActive = hWnd; Window->Wnd->spwndOwner->hWndLastActive = hWnd;
} }
if (Window && WindowPrev) if (Window && WindowPrev)
@ -204,13 +204,13 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin
Wnd = Window->Wnd; Wnd = Window->Wnd;
if ((Wnd->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD) if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{ {
DPRINT("Failed - Child\n"); DPRINT("Failed - Child\n");
return FALSE; return FALSE;
} }
if (0 == (Wnd->Style & WS_VISIBLE) && if (0 == (Wnd->style & WS_VISIBLE) &&
Window->OwnerThread->ThreadsProcess != CsrProcess) Window->OwnerThread->ThreadsProcess != CsrProcess)
{ {
DPRINT("Failed - Invisible\n"); DPRINT("Failed - Invisible\n");
@ -278,7 +278,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
Wnd = Window->Wnd; Wnd = Window->Wnd;
if(Wnd->Style & WS_DISABLED) if(Wnd->style & WS_DISABLED)
{ {
BOOL Ret; BOOL Ret;
PWINDOW_OBJECT TopWnd; PWINDOW_OBJECT TopWnd;
@ -332,9 +332,9 @@ co_IntSetActiveWindow(PWINDOW_OBJECT Window OPTIONAL)
if (Window != 0) if (Window != 0)
{ {
Wnd = Window->Wnd; Wnd = Window->Wnd;
if ((!(Wnd->Style & WS_VISIBLE) && if ((!(Wnd->style & WS_VISIBLE) &&
Window->OwnerThread->ThreadsProcess != CsrProcess) || Window->OwnerThread->ThreadsProcess != CsrProcess) ||
(Wnd->Style & (WS_POPUP | WS_CHILD)) == WS_CHILD) (Wnd->style & (WS_POPUP | WS_CHILD)) == WS_CHILD)
{ {
return ThreadQueue ? 0 : ThreadQueue->ActiveWindow; return ThreadQueue ? 0 : ThreadQueue->ActiveWindow;
} }
@ -585,7 +585,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
ThreadQueue = pti->MessageQueue; ThreadQueue = pti->MessageQueue;
Wnd = Window->Wnd; Wnd = Window->Wnd;
if (Wnd->Style & (WS_MINIMIZE | WS_DISABLED)) if (Wnd->style & (WS_MINIMIZE | WS_DISABLED))
{ {
return( (ThreadQueue ? ThreadQueue->FocusWindow : 0)); return( (ThreadQueue ? ThreadQueue->FocusWindow : 0));
} }

View file

@ -1144,10 +1144,10 @@ IntMouseInput(MOUSEINPUT *mi)
if (DesktopWindow) if (DesktopWindow)
{ {
if(MousePos.x >= DesktopWindow->Wnd->ClientRect.right) if(MousePos.x >= DesktopWindow->Wnd->rcClient.right)
MousePos.x = DesktopWindow->Wnd->ClientRect.right - 1; MousePos.x = DesktopWindow->Wnd->rcClient.right - 1;
if(MousePos.y >= DesktopWindow->Wnd->ClientRect.bottom) if(MousePos.y >= DesktopWindow->Wnd->rcClient.bottom)
MousePos.y = DesktopWindow->Wnd->ClientRect.bottom - 1; MousePos.y = DesktopWindow->Wnd->rcClient.bottom - 1;
UserDereferenceObject(DesktopWindow); UserDereferenceObject(DesktopWindow);
} }

View file

@ -1335,13 +1335,13 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
bti->rgstate[0] = STATE_SYSTEM_FOCUSABLE; bti->rgstate[0] = STATE_SYSTEM_FOCUSABLE;
dwStyle = pWindowObject->Wnd->Style; dwStyle = pWindowObject->Wnd->style;
dwExStyle = pWindowObject->Wnd->ExStyle; dwExStyle = pWindowObject->Wnd->ExStyle;
bti->rcTitleBar.top = 0; bti->rcTitleBar.top = 0;
bti->rcTitleBar.left = 0; bti->rcTitleBar.left = 0;
bti->rcTitleBar.right = pWindowObject->Wnd->WindowRect.right - pWindowObject->Wnd->WindowRect.left; bti->rcTitleBar.right = pWindowObject->Wnd->rcWindow.right - pWindowObject->Wnd->rcWindow.left;
bti->rcTitleBar.bottom = pWindowObject->Wnd->WindowRect.bottom - pWindowObject->Wnd->WindowRect.top; bti->rcTitleBar.bottom = pWindowObject->Wnd->rcWindow.bottom - pWindowObject->Wnd->rcWindow.top;
/* is it iconiced ? */ /* is it iconiced ? */
if ((dwStyle & WS_ICONIC)!=WS_ICONIC) if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
@ -1382,9 +1382,9 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
} }
} }
bti->rcTitleBar.top += pWindowObject->Wnd->WindowRect.top; bti->rcTitleBar.top += pWindowObject->Wnd->rcWindow.top;
bti->rcTitleBar.left += pWindowObject->Wnd->WindowRect.left; bti->rcTitleBar.left += pWindowObject->Wnd->rcWindow.left;
bti->rcTitleBar.right += pWindowObject->Wnd->WindowRect.left; bti->rcTitleBar.right += pWindowObject->Wnd->rcWindow.left;
bti->rcTitleBar.bottom = bti->rcTitleBar.top; bti->rcTitleBar.bottom = bti->rcTitleBar.top;
if (dwExStyle & WS_EX_TOOLWINDOW) if (dwExStyle & WS_EX_TOOLWINDOW)
@ -1425,7 +1425,7 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
{ {
bti->rgstate[4] = STATE_SYSTEM_INVISIBLE; bti->rgstate[4] = STATE_SYSTEM_INVISIBLE;
} }
if (pWindowObject->Wnd->Class->Style & CS_NOCLOSE) if (pWindowObject->Wnd->pcls->Style & CS_NOCLOSE)
{ {
bti->rgstate[5] = STATE_SYSTEM_UNAVAILABLE; bti->rgstate[5] = STATE_SYSTEM_UNAVAILABLE;
} }
@ -2122,13 +2122,13 @@ NtUserGetMenuItemRect(
if(MenuItem->fType & MF_POPUP) if(MenuItem->fType & MF_POPUP)
{ {
XMove = ReferenceWnd->Wnd->ClientRect.left; XMove = ReferenceWnd->Wnd->rcClient.left;
YMove = ReferenceWnd->Wnd->ClientRect.top; YMove = ReferenceWnd->Wnd->rcClient.top;
} }
else else
{ {
XMove = ReferenceWnd->Wnd->WindowRect.left; XMove = ReferenceWnd->Wnd->rcWindow.left;
YMove = ReferenceWnd->Wnd->WindowRect.top; YMove = ReferenceWnd->Wnd->rcWindow.top;
} }
Rect.left += XMove; Rect.left += XMove;
@ -2309,8 +2309,8 @@ NtUserMenuItemFromPoint(
RETURN( -1); RETURN( -1);
} }
X -= Window->Wnd->WindowRect.left; X -= Window->Wnd->rcWindow.left;
Y -= Window->Wnd->WindowRect.top; Y -= Window->Wnd->rcWindow.top;
mi = Menu->MenuItemList; mi = Menu->MenuItemList;
for (i = 0; NULL != mi; i++) for (i = 0; NULL != mi; i++)

View file

@ -694,7 +694,7 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *
{ {
/* generate double click messages, if necessary */ /* generate double click messages, if necessary */
if ((((*HitTest) != HTCLIENT) || if ((((*HitTest) != HTCLIENT) ||
(Window->Wnd->Class->Style & CS_DBLCLKS)) && (Window->Wnd->pcls->Style & CS_DBLCLKS)) &&
MsqIsDblClk(Msg, Remove)) MsqIsDblClk(Msg, Remove))
{ {
Msg->message += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN; Msg->message += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
@ -724,8 +724,8 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT *
{ {
/* NOTE: Msg->pt should remain in screen coordinates. -- FiN */ /* NOTE: Msg->pt should remain in screen coordinates. -- FiN */
Msg->lParam = MAKELONG( Msg->lParam = MAKELONG(
Msg->pt.x - (WORD)Window->Wnd->ClientRect.left, Msg->pt.x - (WORD)Window->Wnd->rcClient.left,
Msg->pt.y - (WORD)Window->Wnd->ClientRect.top); Msg->pt.y - (WORD)Window->Wnd->rcClient.top);
} }
} }
@ -1553,7 +1553,7 @@ co_IntSendMessageTimeoutSingle(HWND hWnd,
RETURN( FALSE); RETURN( FALSE);
} }
Result = (ULONG_PTR)co_IntCallWindowProc(Window->Wnd->WndProc, !Window->Wnd->Unicode, hWnd, Msg, wParam, Result = (ULONG_PTR)co_IntCallWindowProc(Window->Wnd->lpfnWndProc, !Window->Wnd->Unicode, hWnd, Msg, wParam,
lParamPacked,lParamBufferSize); lParamPacked,lParamBufferSize);
if(uResult) if(uResult)
@ -1764,12 +1764,12 @@ co_IntDoSendMessage(HWND hWnd,
if (Window->Wnd->IsSystem) if (Window->Wnd->IsSystem)
{ {
Info.Proc = (!Info.Ansi ? Window->Wnd->WndProc : Window->Wnd->WndProcExtra); Info.Proc = (!Info.Ansi ? Window->Wnd->lpfnWndProc : Window->Wnd->WndProcExtra);
} }
else else
{ {
Info.Ansi = !Window->Wnd->Unicode; Info.Ansi = !Window->Wnd->Unicode;
Info.Proc = Window->Wnd->WndProc; Info.Proc = Window->Wnd->lpfnWndProc;
} }
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, &Result); IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, &Result);

View file

@ -902,8 +902,8 @@ NtUserMonitorFromWindow(
if (!Window->Wnd) if (!Window->Wnd)
RETURN(hMonitor); RETURN(hMonitor);
Rect.left = Rect.right = Window->Wnd->WindowRect.left; Rect.left = Rect.right = Window->Wnd->rcWindow.left;
Rect.top = Rect.bottom = Window->Wnd->WindowRect.bottom; Rect.top = Rect.bottom = Window->Wnd->rcWindow.bottom;
IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags); IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);

View file

@ -64,13 +64,13 @@ IntIntersectWithParents(PWINDOW_OBJECT Child, RECTL *WindowRect)
while (ParentWindow != NULL) while (ParentWindow != NULL)
{ {
ParentWnd = ParentWindow->Wnd; ParentWnd = ParentWindow->Wnd;
if (!(ParentWnd->Style & WS_VISIBLE) || if (!(ParentWnd->style & WS_VISIBLE) ||
(ParentWnd->Style & WS_MINIMIZE)) (ParentWnd->style & WS_MINIMIZE))
{ {
return FALSE; return FALSE;
} }
if (!RECTL_bIntersectRect(WindowRect, WindowRect, &ParentWnd->ClientRect)) if (!RECTL_bIntersectRect(WindowRect, WindowRect, &ParentWnd->rcClient))
{ {
return FALSE; return FALSE;
} }
@ -92,7 +92,7 @@ IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
while (ParentWindow) while (ParentWindow)
{ {
ParentWnd = ParentWindow->Wnd; ParentWnd = ParentWindow->Wnd;
if (ParentWnd->Style & WS_CLIPCHILDREN) if (ParentWnd->style & WS_CLIPCHILDREN)
break; break;
if (ParentWindow->UpdateRegion != 0) if (ParentWindow->UpdateRegion != 0)
@ -125,19 +125,19 @@ IntCalcWindowRgn(PWINDOW_OBJECT Window, BOOL Client)
Wnd = Window->Wnd; Wnd = Window->Wnd;
if (Client) if (Client)
hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Wnd->ClientRect); hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Wnd->rcClient);
else else
hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Wnd->WindowRect); hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Wnd->rcWindow);
if (Window->WindowRegion != NULL && !(Wnd->Style & WS_MINIMIZE)) if (Window->WindowRegion != NULL && !(Wnd->style & WS_MINIMIZE))
{ {
NtGdiOffsetRgn(hRgnWindow, NtGdiOffsetRgn(hRgnWindow,
-Wnd->WindowRect.left, -Wnd->rcWindow.left,
-Wnd->WindowRect.top); -Wnd->rcWindow.top);
RgnType = NtGdiCombineRgn(hRgnWindow, hRgnWindow, Window->WindowRegion, RGN_AND); RgnType = NtGdiCombineRgn(hRgnWindow, hRgnWindow, Window->WindowRegion, RGN_AND);
NtGdiOffsetRgn(hRgnWindow, NtGdiOffsetRgn(hRgnWindow,
Wnd->WindowRect.left, Wnd->rcWindow.left,
Wnd->WindowRect.top); Wnd->rcWindow.top);
} }
return hRgnWindow; return hRgnWindow;
@ -304,8 +304,8 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
/* /*
* Paint child windows. * Paint child windows.
*/ */
if (!(Flags & RDW_NOCHILDREN) && !(Wnd->Style & WS_MINIMIZE) && if (!(Flags & RDW_NOCHILDREN) && !(Wnd->style & WS_MINIMIZE) &&
((Flags & RDW_ALLCHILDREN) || !(Wnd->Style & WS_CLIPCHILDREN))) ((Flags & RDW_ALLCHILDREN) || !(Wnd->style & WS_CLIPCHILDREN)))
{ {
HWND *List, *phWnd; HWND *List, *phWnd;
@ -316,7 +316,7 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
{ {
Window = UserGetWindowObject(*phWnd); Window = UserGetWindowObject(*phWnd);
Wnd = Window->Wnd; Wnd = Window->Wnd;
if (Window && (Wnd->Style & WS_VISIBLE)) if (Window && (Wnd->style & WS_VISIBLE))
{ {
USER_REFERENCE_ENTRY Ref; USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Window, &Ref); UserRefObjectCo(Window, &Ref);
@ -353,7 +353,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
{ {
HRGN hRgnClient; HRGN hRgnClient;
hRgnClient = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->ClientRect); hRgnClient = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND); RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND);
GreDeleteObject(hRgnClient); GreDeleteObject(hRgnClient);
} }
@ -362,23 +362,23 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
* Clip the given region with window rectangle (or region) * Clip the given region with window rectangle (or region)
*/ */
if (!Window->WindowRegion || (Wnd->Style & WS_MINIMIZE)) if (!Window->WindowRegion || (Wnd->style & WS_MINIMIZE))
{ {
HRGN hRgnWindow; HRGN hRgnWindow;
hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect); hRgnWindow = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND); RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND);
GreDeleteObject(hRgnWindow); GreDeleteObject(hRgnWindow);
} }
else else
{ {
NtGdiOffsetRgn(hRgn, NtGdiOffsetRgn(hRgn,
-Wnd->WindowRect.left, -Wnd->rcWindow.left,
-Wnd->WindowRect.top); -Wnd->rcWindow.top);
RgnType = NtGdiCombineRgn(hRgn, hRgn, Window->WindowRegion, RGN_AND); RgnType = NtGdiCombineRgn(hRgn, hRgn, Window->WindowRegion, RGN_AND);
NtGdiOffsetRgn(hRgn, NtGdiOffsetRgn(hRgn,
Wnd->WindowRect.left, Wnd->rcWindow.left,
Wnd->WindowRect.top); Wnd->rcWindow.top);
} }
/* /*
@ -452,14 +452,14 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
* Process children if needed * Process children if needed
*/ */
if (!(Flags & RDW_NOCHILDREN) && !(Wnd->Style & WS_MINIMIZE) && if (!(Flags & RDW_NOCHILDREN) && !(Wnd->style & WS_MINIMIZE) &&
((Flags & RDW_ALLCHILDREN) || !(Wnd->Style & WS_CLIPCHILDREN))) ((Flags & RDW_ALLCHILDREN) || !(Wnd->style & WS_CLIPCHILDREN)))
{ {
PWINDOW_OBJECT Child; PWINDOW_OBJECT Child;
for (Child = Window->FirstChild; Child; Child = Child->NextSibling) for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
{ {
if (Child->Wnd->Style & WS_VISIBLE) if (Child->Wnd->style & WS_VISIBLE)
{ {
/* /*
* Recursive call to update children UpdateRegion * Recursive call to update children UpdateRegion
@ -516,8 +516,8 @@ IntIsWindowDrawable(PWINDOW_OBJECT Window)
for (WndObject = Window; WndObject != NULL; WndObject = WndObject->Parent) for (WndObject = Window; WndObject != NULL; WndObject = WndObject->Parent)
{ {
Wnd = WndObject->Wnd; Wnd = WndObject->Wnd;
if (!(Wnd->Style & WS_VISIBLE) || if (!(Wnd->style & WS_VISIBLE) ||
((Wnd->Style & WS_MINIMIZE) && (WndObject != Window))) ((Wnd->style & WS_MINIMIZE) && (WndObject != Window)))
{ {
return FALSE; return FALSE;
} }
@ -568,26 +568,26 @@ co_UserRedrawWindow(PWINDOW_OBJECT Window, const RECTL* UpdateRect, HRGN UpdateR
hRgn = NULL; hRgn = NULL;
} }
else else
NtGdiOffsetRgn(hRgn, Window->Wnd->ClientRect.left, Window->Wnd->ClientRect.top); NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
} }
else if (UpdateRect != NULL) else if (UpdateRect != NULL)
{ {
if (!RECTL_bIsEmptyRect(UpdateRect)) if (!RECTL_bIsEmptyRect(UpdateRect))
{ {
hRgn = UnsafeIntCreateRectRgnIndirect((RECTL *)UpdateRect); hRgn = UnsafeIntCreateRectRgnIndirect((RECTL *)UpdateRect);
NtGdiOffsetRgn(hRgn, Window->Wnd->ClientRect.left, Window->Wnd->ClientRect.top); NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
} }
} }
else if ((Flags & (RDW_INVALIDATE | RDW_FRAME)) == (RDW_INVALIDATE | RDW_FRAME) || else if ((Flags & (RDW_INVALIDATE | RDW_FRAME)) == (RDW_INVALIDATE | RDW_FRAME) ||
(Flags & (RDW_VALIDATE | RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME)) (Flags & (RDW_VALIDATE | RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME))
{ {
if (!RECTL_bIsEmptyRect(&Window->Wnd->WindowRect)) if (!RECTL_bIsEmptyRect(&Window->Wnd->rcWindow))
hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect); hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
} }
else else
{ {
if (!RECTL_bIsEmptyRect(&Window->Wnd->ClientRect)) if (!RECTL_bIsEmptyRect(&Window->Wnd->rcClient))
hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->ClientRect); hRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
} }
} }
@ -629,7 +629,7 @@ BOOL FASTCALL
IntIsWindowDirty(PWINDOW_OBJECT Window) IntIsWindowDirty(PWINDOW_OBJECT Window)
{ {
PWINDOW Wnd = Window->Wnd; PWINDOW Wnd = Window->Wnd;
return (Wnd->Style & WS_VISIBLE) && return (Wnd->style & WS_VISIBLE) &&
((Window->UpdateRegion != NULL) || ((Window->UpdateRegion != NULL) ||
(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) || (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT) ||
(Window->Flags & WINDOWOBJECT_NEED_NCPAINT)); (Window->Flags & WINDOWOBJECT_NEED_NCPAINT));
@ -841,7 +841,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
} }
if (Window->UpdateRegion) if (Window->UpdateRegion)
{ {
if (!(Wnd->Style & WS_CLIPCHILDREN)) if (!(Wnd->style & WS_CLIPCHILDREN))
{ {
PWINDOW_OBJECT Child; PWINDOW_OBJECT Child;
for (Child = Window->FirstChild; Child; Child = Child->NextSibling) for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
@ -937,11 +937,11 @@ co_UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase)
} }
else else
{ {
Rect = Window->Wnd->ClientRect; Rect = Window->Wnd->rcClient;
IntIntersectWithParents(Window, &Rect); IntIntersectWithParents(Window, &Rect);
NtGdiSetRectRgn(hRgn, Rect.left, Rect.top, Rect.right, Rect.bottom); NtGdiSetRectRgn(hRgn, Rect.left, Rect.top, Rect.right, Rect.bottom);
RegionType = NtGdiCombineRgn(hRgn, hRgn, Window->UpdateRegion, RGN_AND); RegionType = NtGdiCombineRgn(hRgn, hRgn, Window->UpdateRegion, RGN_AND);
NtGdiOffsetRgn(hRgn, -Window->Wnd->ClientRect.left, -Window->Wnd->ClientRect.top); NtGdiOffsetRgn(hRgn, -Window->Wnd->rcClient.left, -Window->Wnd->rcClient.top);
} }
if (bErase && RegionType != NULLREGION && RegionType != ERROR) if (bErase && RegionType != NULLREGION && RegionType != ERROR)
@ -1021,7 +1021,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
/* Get the update region bounding box. */ /* Get the update region bounding box. */
if (Window->UpdateRegion == (HRGN)1) if (Window->UpdateRegion == (HRGN)1)
{ {
Rect = Window->Wnd->ClientRect; Rect = Window->Wnd->rcClient;
} }
else else
{ {
@ -1031,14 +1031,14 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
REGION_UnlockRgn(RgnData); REGION_UnlockRgn(RgnData);
if (RegionType != ERROR && RegionType != NULLREGION) if (RegionType != ERROR && RegionType != NULLREGION)
RECTL_bIntersectRect(&Rect, &Rect, &Window->Wnd->ClientRect); RECTL_bIntersectRect(&Rect, &Rect, &Window->Wnd->rcClient);
} }
if (IntIntersectWithParents(Window, &Rect)) if (IntIntersectWithParents(Window, &Rect))
{ {
RECTL_vOffsetRect(&Rect, RECTL_vOffsetRect(&Rect,
-Window->Wnd->ClientRect.left, -Window->Wnd->rcClient.left,
-Window->Wnd->ClientRect.top); -Window->Wnd->rcClient.top);
} else } else
{ {
Rect.left = Rect.top = Rect.right = Rect.bottom = 0; Rect.left = Rect.top = Rect.right = Rect.bottom = 0;
@ -1427,7 +1427,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *prcUnsafeScroll,
IntGetClientOrigin(Window, &ClientOrigin); IntGetClientOrigin(Window, &ClientOrigin);
for (Child = Window->FirstChild; Child; Child = Child->NextSibling) for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
{ {
rcChild = Child->Wnd->WindowRect; rcChild = Child->Wnd->rcWindow;
rcChild.left -= ClientOrigin.x; rcChild.left -= ClientOrigin.x;
rcChild.top -= ClientOrigin.y; rcChild.top -= ClientOrigin.y;
rcChild.right -= ClientOrigin.x; rcChild.right -= ClientOrigin.x;
@ -1513,12 +1513,12 @@ UserDrawSysMenuButton(
/* Get the icon to draw. We don't care about WM_GETICON here. */ /* Get the icon to draw. We don't care about WM_GETICON here. */
hIcon = pWnd->Wnd->Class->hIconSm; hIcon = pWnd->Wnd->pcls->hIconSm;
if(!hIcon) if(!hIcon)
{ {
DPRINT("Wnd class has no small icon.\n"); DPRINT("Wnd class has no small icon.\n");
hIcon = pWnd->Wnd->Class->hIcon; hIcon = pWnd->Wnd->pcls->hIcon;
} }
if(!hIcon) if(!hIcon)
@ -1661,7 +1661,7 @@ BOOL UserDrawCaption(
if ((!hIcon) && (Wnd != NULL)) if ((!hIcon) && (Wnd != NULL))
{ {
HasIcon = (uFlags & DC_ICON) && (Wnd->Style & WS_SYSMENU) HasIcon = (uFlags & DC_ICON) && (Wnd->style & WS_SYSMENU)
&& !(uFlags & DC_SMALLCAP) && !(Wnd->ExStyle & WS_EX_DLGMODALFRAME) && !(uFlags & DC_SMALLCAP) && !(Wnd->ExStyle & WS_EX_DLGMODALFRAME)
&& !(Wnd->ExStyle & WS_EX_TOOLWINDOW); && !(Wnd->ExStyle & WS_EX_TOOLWINDOW);
} }
@ -1740,12 +1740,12 @@ BOOL UserDrawCaption(
if (Wnd != NULL) if (Wnd != NULL)
{ {
if(Wnd->Style & WS_SYSMENU) if(Wnd->style & WS_SYSMENU)
{ {
r.right -= 3 + ButtonWidth; r.right -= 3 + ButtonWidth;
if(!(uFlags & DC_SMALLCAP)) if(!(uFlags & DC_SMALLCAP))
{ {
if(Wnd->Style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX)) if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
r.right -= 2 + 2 * ButtonWidth; r.right -= 2 + 2 * ButtonWidth;
else r.right -= 2; else r.right -= 2;
r.right -= 2; r.right -= 2;
@ -1833,12 +1833,12 @@ BOOL UserDrawCaption(
ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2; ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2;
else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2; else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2;
if ((Wnd != NULL) && (Wnd->Style & WS_SYSMENU)) if ((Wnd != NULL) && (Wnd->style & WS_SYSMENU))
{ {
r.right -= 3 + ButtonWidth; r.right -= 3 + ButtonWidth;
if(! (uFlags & DC_SMALLCAP)) if(! (uFlags & DC_SMALLCAP))
{ {
if(Wnd->Style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX)) if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
r.right -= 2 + 2 * ButtonWidth; r.right -= 2 + 2 * ButtonWidth;
else r.right -= 2; else r.right -= 2;
r.right -= 2; r.right -= 2;
@ -1850,7 +1850,7 @@ BOOL UserDrawCaption(
if (str) if (str)
UserDrawCaptionText(hMemDc, str, &r, uFlags); UserDrawCaptionText(hMemDc, str, &r, uFlags);
else if (pWnd != NULL) else if (pWnd != NULL)
UserDrawCaptionText(hMemDc, &pWnd->Wnd->WindowName, &r, uFlags); UserDrawCaptionText(hMemDc, &pWnd->Wnd->strName, &r, uFlags);
} }
if(!NtGdiBitBlt(hDc, lpRc->left, lpRc->top, if(!NtGdiBitBlt(hDc, lpRc->left, lpRc->top,

View file

@ -61,8 +61,8 @@ IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
{ {
BOOL vertical; BOOL vertical;
PWINDOW Wnd = Window->Wnd; PWINDOW Wnd = Window->Wnd;
RECTL ClientRect = Window->Wnd->ClientRect; RECTL ClientRect = Window->Wnd->rcClient;
RECTL WindowRect = Window->Wnd->WindowRect; RECTL WindowRect = Window->Wnd->rcWindow;
switch (nBar) switch (nBar)
{ {
@ -92,7 +92,7 @@ IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
case SB_CTL: case SB_CTL:
IntGetClientRect (Window, lprect); IntGetClientRect (Window, lprect);
vertical = ((Wnd->Style & SBS_VERT) != 0); vertical = ((Wnd->style & SBS_VERT) != 0);
break; break;
default: default:
@ -121,7 +121,7 @@ IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPS
break; break;
case SB_CTL: case SB_CTL:
IntGetClientRect(Window, &ClientRect); IntGetClientRect(Window, &ClientRect);
if(Wnd->Style & SBS_VERT) if(Wnd->style & SBS_VERT)
{ {
Thumb = UserGetSystemMetrics(SM_CYVSCROLL); Thumb = UserGetSystemMetrics(SM_CYVSCROLL);
cxy = ClientRect.bottom - ClientRect.top; cxy = ClientRect.bottom - ClientRect.top;
@ -392,10 +392,10 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR
if (bRedraw) if (bRedraw)
{ {
RECTL UpdateRect = psbi->rcScrollBar; RECTL UpdateRect = psbi->rcScrollBar;
UpdateRect.left -= Window->Wnd->ClientRect.left - Window->Wnd->WindowRect.left; UpdateRect.left -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
UpdateRect.right -= Window->Wnd->ClientRect.left - Window->Wnd->WindowRect.left; UpdateRect.right -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
UpdateRect.top -= Window->Wnd->ClientRect.top - Window->Wnd->WindowRect.top; UpdateRect.top -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
UpdateRect.bottom -= Window->Wnd->ClientRect.top - Window->Wnd->WindowRect.top; UpdateRect.bottom -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME);
} }
@ -465,8 +465,8 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window)
RtlZeroMemory(Window->Scroll, Size); RtlZeroMemory(Window->Scroll, Size);
Result = co_WinPosGetNonClientSize(Window, Result = co_WinPosGetNonClientSize(Window,
&Window->Wnd->WindowRect, &Window->Wnd->rcWindow,
&Window->Wnd->ClientRect); &Window->Wnd->rcClient);
for(s = SB_HORZ; s <= SB_VERT; s++) for(s = SB_HORZ; s <= SB_VERT; s++)
{ {
@ -705,7 +705,7 @@ NtUserEnableScrollBar(
if(InfoH) if(InfoH)
Chg = (IntEnableScrollBar(TRUE, InfoH, wArrows) || Chg); Chg = (IntEnableScrollBar(TRUE, InfoH, wArrows) || Chg);
//if(Chg && (Window->Style & WS_VISIBLE)) //if(Chg && (Window->style & WS_VISIBLE))
/* FIXME - repaint scrollbars */ /* FIXME - repaint scrollbars */
RETURN( TRUE); RETURN( TRUE);
@ -867,20 +867,20 @@ co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
return( TRUE); return( TRUE);
} }
OldStyle = Wnd->Style; OldStyle = Wnd->style;
if(bShow) if(bShow)
Wnd->Style |= Style; Wnd->style |= Style;
else else
Wnd->Style &= ~Style; Wnd->style &= ~Style;
if(Wnd->Style != OldStyle) if(Wnd->style != OldStyle)
{ {
if(Wnd->Style & WS_HSCROLL) if(Wnd->style & WS_HSCROLL)
IntUpdateSBInfo(Window, SB_HORZ); IntUpdateSBInfo(Window, SB_HORZ);
if(Wnd->Style & WS_VSCROLL) if(Wnd->style & WS_VSCROLL)
IntUpdateSBInfo(Window, SB_VERT); IntUpdateSBInfo(Window, SB_VERT);
if(Wnd->Style & WS_VISIBLE) if(Wnd->style & WS_VISIBLE)
{ {
/* Frame has been changed, let the window redraw itself */ /* Frame has been changed, let the window redraw itself */
co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |

View file

@ -252,7 +252,7 @@ NtUserCallOneParam(
RETURN( FALSE); RETURN( FALSE);
} }
Result = (DWORD)Window->Wnd->Instance; Result = (DWORD)Window->Wnd->hModule;
RETURN( Result); RETURN( Result);
} }
@ -686,7 +686,7 @@ NtUserCallHwndLock(
PMENU_OBJECT Menu; PMENU_OBJECT Menu;
DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n"); DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
Ret = FALSE; Ret = FALSE;
if (!((Wnd->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD)) if (!((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
break; break;
if(!(Menu = UserGetMenuObject((HMENU) Wnd->IDMenu))) if(!(Menu = UserGetMenuObject((HMENU) Wnd->IDMenu)))

View file

@ -43,18 +43,18 @@ VIS_ComputeVisibleRegion(
Wnd = Window->Wnd; Wnd = Window->Wnd;
if (!Wnd || !(Wnd->Style & WS_VISIBLE)) if (!Wnd || !(Wnd->style & WS_VISIBLE))
{ {
return NULL; return NULL;
} }
if (ClientArea) if (ClientArea)
{ {
VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->ClientRect); VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
} }
else else
{ {
VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect); VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
} }
/* /*
@ -69,33 +69,33 @@ VIS_ComputeVisibleRegion(
while (CurrentWindow) while (CurrentWindow)
{ {
CurrentWnd = CurrentWindow->Wnd; CurrentWnd = CurrentWindow->Wnd;
if (!(CurrentWnd) || !(CurrentWnd->Style & WS_VISIBLE)) if (!(CurrentWnd) || !(CurrentWnd->style & WS_VISIBLE))
{ {
GreDeleteObject(VisRgn); GreDeleteObject(VisRgn);
return NULL; return NULL;
} }
ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWnd->ClientRect); ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWnd->rcClient);
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND); NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND);
GreDeleteObject(ClipRgn); GreDeleteObject(ClipRgn);
if ((PreviousWnd->Style & WS_CLIPSIBLINGS) || if ((PreviousWnd->style & WS_CLIPSIBLINGS) ||
(PreviousWnd == Wnd && ClipSiblings)) (PreviousWnd == Wnd && ClipSiblings))
{ {
CurrentSibling = CurrentWindow->FirstChild; CurrentSibling = CurrentWindow->FirstChild;
while (CurrentSibling != NULL && CurrentSibling != PreviousWindow) while (CurrentSibling != NULL && CurrentSibling != PreviousWindow)
{ {
CurrentSiblingWnd = CurrentSibling->Wnd; CurrentSiblingWnd = CurrentSibling->Wnd;
if ((CurrentSiblingWnd->Style & WS_VISIBLE) && if ((CurrentSiblingWnd->style & WS_VISIBLE) &&
!(CurrentSiblingWnd->ExStyle & WS_EX_TRANSPARENT)) !(CurrentSiblingWnd->ExStyle & WS_EX_TRANSPARENT))
{ {
ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentSiblingWnd->WindowRect); ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentSiblingWnd->rcWindow);
/* Combine it with the window region if available */ /* Combine it with the window region if available */
if (CurrentSibling->WindowRegion && !(CurrentSiblingWnd->Style & WS_MINIMIZE)) if (CurrentSibling->WindowRegion && !(CurrentSiblingWnd->style & WS_MINIMIZE))
{ {
NtGdiOffsetRgn(ClipRgn, -CurrentSiblingWnd->WindowRect.left, -CurrentSiblingWnd->WindowRect.top); NtGdiOffsetRgn(ClipRgn, -CurrentSiblingWnd->rcWindow.left, -CurrentSiblingWnd->rcWindow.top);
NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentSibling->WindowRegion, RGN_AND); NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentSibling->WindowRegion, RGN_AND);
NtGdiOffsetRgn(ClipRgn, CurrentSiblingWnd->WindowRect.left, CurrentSiblingWnd->WindowRect.top); NtGdiOffsetRgn(ClipRgn, CurrentSiblingWnd->rcWindow.left, CurrentSiblingWnd->rcWindow.top);
} }
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF); NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
GreDeleteObject(ClipRgn); GreDeleteObject(ClipRgn);
@ -115,16 +115,16 @@ VIS_ComputeVisibleRegion(
while (CurrentWindow) while (CurrentWindow)
{ {
CurrentWnd = CurrentWindow->Wnd; CurrentWnd = CurrentWindow->Wnd;
if ((CurrentWnd->Style & WS_VISIBLE) && if ((CurrentWnd->style & WS_VISIBLE) &&
!(CurrentWnd->ExStyle & WS_EX_TRANSPARENT)) !(CurrentWnd->ExStyle & WS_EX_TRANSPARENT))
{ {
ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWnd->WindowRect); ClipRgn = UnsafeIntCreateRectRgnIndirect(&CurrentWnd->rcWindow);
/* Combine it with the window region if available */ /* Combine it with the window region if available */
if (CurrentWindow->WindowRegion && !(CurrentWnd->Style & WS_MINIMIZE)) if (CurrentWindow->WindowRegion && !(CurrentWnd->style & WS_MINIMIZE))
{ {
NtGdiOffsetRgn(ClipRgn, -CurrentWnd->WindowRect.left, -CurrentWnd->WindowRect.top); NtGdiOffsetRgn(ClipRgn, -CurrentWnd->rcWindow.left, -CurrentWnd->rcWindow.top);
NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentWindow->WindowRegion, RGN_AND); NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentWindow->WindowRegion, RGN_AND);
NtGdiOffsetRgn(ClipRgn, CurrentWnd->WindowRect.left, CurrentWnd->WindowRect.top); NtGdiOffsetRgn(ClipRgn, CurrentWnd->rcWindow.left, CurrentWnd->rcWindow.top);
} }
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF); NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
GreDeleteObject(ClipRgn); GreDeleteObject(ClipRgn);
@ -133,11 +133,11 @@ VIS_ComputeVisibleRegion(
} }
} }
if (Window->WindowRegion && !(Wnd->Style & WS_MINIMIZE)) if (Window->WindowRegion && !(Wnd->style & WS_MINIMIZE))
{ {
NtGdiOffsetRgn(VisRgn, -Wnd->WindowRect.left, -Wnd->WindowRect.top); NtGdiOffsetRgn(VisRgn, -Wnd->rcWindow.left, -Wnd->rcWindow.top);
NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND); NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND);
NtGdiOffsetRgn(VisRgn, Wnd->WindowRect.left, Wnd->WindowRect.top); NtGdiOffsetRgn(VisRgn, Wnd->rcWindow.left, Wnd->rcWindow.top);
} }
return VisRgn; return VisRgn;
@ -165,8 +165,8 @@ co_VIS_WindowLayoutChanged(
{ {
ParentWnd = Parent->Wnd; ParentWnd = Parent->Wnd;
NtGdiOffsetRgn(Temp, NtGdiOffsetRgn(Temp,
Wnd->WindowRect.left - ParentWnd->ClientRect.left, Wnd->rcWindow.left - ParentWnd->rcClient.left,
Wnd->WindowRect.top - ParentWnd->ClientRect.top); Wnd->rcWindow.top - ParentWnd->rcClient.top);
UserRefObjectCo(Parent, &Ref); UserRefObjectCo(Parent, &Ref);
co_UserRedrawWindow(Parent, NULL, Temp, co_UserRedrawWindow(Parent, NULL, Temp,

View file

@ -125,8 +125,8 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
{ {
if (Type == DCE_WINDOW_DC) if (Type == DCE_WINDOW_DC)
{ {
if (Wnd->Style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN; if (Wnd->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
if (Wnd->Style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS; if (Wnd->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
} }
} }
} }
@ -152,13 +152,13 @@ DceSetDrawable(PWINDOW_OBJECT Window OPTIONAL, HDC hDC, ULONG Flags,
Wnd = Window->Wnd; Wnd = Window->Wnd;
if (Flags & DCX_WINDOW) if (Flags & DCX_WINDOW)
{ {
dc->ptlDCOrig.x = Wnd->WindowRect.left; dc->ptlDCOrig.x = Wnd->rcWindow.left;
dc->ptlDCOrig.y = Wnd->WindowRect.top; dc->ptlDCOrig.y = Wnd->rcWindow.top;
} }
else else
{ {
dc->ptlDCOrig.x = Wnd->ClientRect.left; dc->ptlDCOrig.x = Wnd->rcClient.left;
dc->ptlDCOrig.y = Wnd->ClientRect.top; dc->ptlDCOrig.y = Wnd->rcClient.top;
} }
} }
DC_UnlockDc(dc); DC_UnlockDc(dc);
@ -251,7 +251,7 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
ParentWnd = Parent->Wnd; ParentWnd = Parent->Wnd;
if (ParentWnd->Style & WS_CLIPSIBLINGS) if (ParentWnd->style & WS_CLIPSIBLINGS)
{ {
DcxFlags = DCX_CLIPSIBLINGS | DcxFlags = DCX_CLIPSIBLINGS |
(Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW)); (Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW));
@ -267,7 +267,7 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if (NULL != DesktopWindow) if (NULL != DesktopWindow)
{ {
hRgnVisible = UnsafeIntCreateRectRgnIndirect(&DesktopWindow->Wnd->WindowRect); hRgnVisible = UnsafeIntCreateRectRgnIndirect(&DesktopWindow->Wnd->rcWindow);
} }
else else
{ {
@ -342,20 +342,20 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP); Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
if (!(Flags & DCX_WINDOW)) // not window rectangle if (!(Flags & DCX_WINDOW)) // not window rectangle
{ {
if (Wnd->Class->Style & CS_PARENTDC) if (Wnd->pcls->Style & CS_PARENTDC)
{ {
Flags |= DCX_PARENTCLIP; Flags |= DCX_PARENTCLIP;
} }
if (!(Flags & DCX_CACHE) && // Not on the cheap wine list. if (!(Flags & DCX_CACHE) && // Not on the cheap wine list.
!(Wnd->Class->Style & CS_OWNDC) ) !(Wnd->pcls->Style & CS_OWNDC) )
{ {
if (!(Wnd->Class->Style & CS_CLASSDC)) if (!(Wnd->pcls->Style & CS_CLASSDC))
// The window is not POWNED or has any CLASS, so we are looking for cheap wine. // The window is not POWNED or has any CLASS, so we are looking for cheap wine.
Flags |= DCX_CACHE; Flags |= DCX_CACHE;
else else
{ {
if (Wnd->Class->Dce) hDC = ((PDCE)Wnd->Class->Dce)->hDC; if (Wnd->pcls->Dce) hDC = ((PDCE)Wnd->pcls->Dce)->hDC;
DPRINT("We have CLASS!!\n"); DPRINT("We have CLASS!!\n");
} }
} }
@ -365,20 +365,20 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
if (Window->Dce) DPRINT1("We have POWNER with DCE!!\n"); if (Window->Dce) DPRINT1("We have POWNER with DCE!!\n");
} }
*/ */
if (Wnd->Style & WS_CLIPSIBLINGS) if (Wnd->style & WS_CLIPSIBLINGS)
{ {
Flags |= DCX_CLIPSIBLINGS; Flags |= DCX_CLIPSIBLINGS;
} }
if (Wnd->Style & WS_CLIPCHILDREN && if (Wnd->style & WS_CLIPCHILDREN &&
!(Wnd->Style & WS_MINIMIZE)) !(Wnd->style & WS_MINIMIZE))
{ {
Flags |= DCX_CLIPCHILDREN; Flags |= DCX_CLIPCHILDREN;
} }
} }
else else
{ {
if (Wnd->Style & WS_CLIPSIBLINGS) Flags |= DCX_CLIPSIBLINGS; if (Wnd->style & WS_CLIPSIBLINGS) Flags |= DCX_CLIPSIBLINGS;
Flags |= DCX_CACHE; Flags |= DCX_CACHE;
} }
} }
@ -393,7 +393,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Parent = (Window ? Window->Parent : NULL); Parent = (Window ? Window->Parent : NULL);
if (NULL == Window || !(Wnd->Style & WS_CHILD) || NULL == Parent) if (NULL == Window || !(Wnd->style & WS_CHILD) || NULL == Parent)
{ {
Flags &= ~DCX_PARENTCLIP; Flags &= ~DCX_PARENTCLIP;
Flags |= DCX_CLIPSIBLINGS; Flags |= DCX_CLIPSIBLINGS;
@ -404,11 +404,11 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
if (Flags & DCX_PARENTCLIP) if (Flags & DCX_PARENTCLIP)
{ {
if ((Wnd->Style & WS_VISIBLE) && if ((Wnd->style & WS_VISIBLE) &&
(Parent->Wnd->Style & WS_VISIBLE)) (Parent->Wnd->style & WS_VISIBLE))
{ {
Flags &= ~DCX_CLIPCHILDREN; Flags &= ~DCX_CLIPCHILDREN;
if (Parent->Wnd->Style & WS_CLIPSIBLINGS) if (Parent->Wnd->style & WS_CLIPSIBLINGS)
{ {
Flags |= DCX_CLIPSIBLINGS; Flags |= DCX_CLIPSIBLINGS;
} }
@ -543,11 +543,11 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
{ {
if (!(Flags & DCX_WINDOW)) if (!(Flags & DCX_WINDOW))
{ {
Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->ClientRect); Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcClient);
} }
else else
{ {
Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect); Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
} }
Dce->DCXFlags &= ~DCX_KEEPCLIPRGN; Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
} }
@ -646,8 +646,8 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
{ {
if (!(pDCE->DCXFlags & DCX_CACHE)) /* owned or Class DCE*/ if (!(pDCE->DCXFlags & DCX_CACHE)) /* owned or Class DCE*/
{ {
if (Window->Wnd->Class->Style & CS_CLASSDC || if (Window->Wnd->pcls->Style & CS_CLASSDC ||
Window->Wnd->Style & CS_CLASSDC) /* Test Class first */ Window->Wnd->style & CS_CLASSDC) /* Test Class first */
{ {
if (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE*/ if (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE*/
DceDeleteClipRgn(pDCE); DceDeleteClipRgn(pDCE);
@ -657,8 +657,8 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
pDCE->DCXFlags = DCX_DCEEMPTY; pDCE->DCXFlags = DCX_DCEEMPTY;
pDCE->hwndCurrent = 0; pDCE->hwndCurrent = 0;
} }
else if (Window->Wnd->Class->Style & CS_OWNDC || else if (Window->Wnd->pcls->Style & CS_OWNDC ||
Window->Wnd->Style & CS_OWNDC) /* owned DCE*/ Window->Wnd->style & CS_OWNDC) /* owned DCE*/
{ {
pDCE = DceFreeDCE(pDCE, FALSE); pDCE = DceFreeDCE(pDCE, FALSE);
if (!pDCE) break; if (!pDCE) break;
@ -771,17 +771,17 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
{ {
if (pDCE->DCXFlags & DCX_WINDOW) if (pDCE->DCXFlags & DCX_WINDOW)
{ {
DeltaX = CurrentWindow->Wnd->WindowRect.left - dc->ptlDCOrig.x; DeltaX = CurrentWindow->Wnd->rcWindow.left - dc->ptlDCOrig.x;
DeltaY = CurrentWindow->Wnd->WindowRect.top - dc->ptlDCOrig.y; DeltaY = CurrentWindow->Wnd->rcWindow.top - dc->ptlDCOrig.y;
dc->ptlDCOrig.x = CurrentWindow->Wnd->WindowRect.left; dc->ptlDCOrig.x = CurrentWindow->Wnd->rcWindow.left;
dc->ptlDCOrig.y = CurrentWindow->Wnd->WindowRect.top; dc->ptlDCOrig.y = CurrentWindow->Wnd->rcWindow.top;
} }
else else
{ {
DeltaX = CurrentWindow->Wnd->ClientRect.left - dc->ptlDCOrig.x; DeltaX = CurrentWindow->Wnd->rcClient.left - dc->ptlDCOrig.x;
DeltaY = CurrentWindow->Wnd->ClientRect.top - dc->ptlDCOrig.y; DeltaY = CurrentWindow->Wnd->rcClient.top - dc->ptlDCOrig.y;
dc->ptlDCOrig.x = CurrentWindow->Wnd->ClientRect.left; dc->ptlDCOrig.x = CurrentWindow->Wnd->rcClient.left;
dc->ptlDCOrig.y = CurrentWindow->Wnd->ClientRect.top; dc->ptlDCOrig.y = CurrentWindow->Wnd->rcClient.top;
} }
if (NULL != dc->rosdc.hClipRgn) if (NULL != dc->rosdc.hClipRgn)
{ {

View file

@ -174,11 +174,11 @@ IntGetParent(PWINDOW_OBJECT Wnd)
{ {
if (!Wnd->Wnd) return NULL; if (!Wnd->Wnd) return NULL;
if (Wnd->Wnd->Style & WS_POPUP) if (Wnd->Wnd->style & WS_POPUP)
{ {
return UserGetWindowObject(Wnd->hOwner); return UserGetWindowObject(Wnd->hOwner);
} }
else if (Wnd->Wnd->Style & WS_CHILD) else if (Wnd->Wnd->style & WS_CHILD)
{ {
return Wnd->Parent; return Wnd->Parent;
} }
@ -325,13 +325,13 @@ UserFreeWindowInfo(PW32THREADINFO ti, PWINDOW_OBJECT WindowObject)
ClientInfo->CallbackWnd.pvWnd = NULL; ClientInfo->CallbackWnd.pvWnd = NULL;
} }
if (Wnd->WindowName.Buffer != NULL) if (Wnd->strName.Buffer != NULL)
{ {
Wnd->WindowName.Length = 0; Wnd->strName.Length = 0;
Wnd->WindowName.MaximumLength = 0; Wnd->strName.MaximumLength = 0;
DesktopHeapFree(Wnd->pdesktop, DesktopHeapFree(Wnd->pdesktop,
Wnd->WindowName.Buffer); Wnd->strName.Buffer);
Wnd->WindowName.Buffer = NULL; Wnd->strName.Buffer = NULL;
} }
DesktopHeapFree(Wnd->pdesktop, Wnd); DesktopHeapFree(Wnd->pdesktop, Wnd);
@ -369,7 +369,7 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
return 0; return 0;
} }
Window->Status |= WINDOWSTATUS_DESTROYING; Window->Status |= WINDOWSTATUS_DESTROYING;
Wnd->Style &= ~WS_VISIBLE; Wnd->style &= ~WS_VISIBLE;
/* remove the window already at this point from the thread window list so we /* remove the window already at this point from the thread window list so we
don't get into trouble when destroying the thread windows while we're still don't get into trouble when destroying the thread windows while we're still
in IntDestroyWindow() */ in IntDestroyWindow() */
@ -457,7 +457,7 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
TIMER_RemoveWindowTimers(Window->hSelf); TIMER_RemoveWindowTimers(Window->hSelf);
#endif #endif
if (!(Wnd->Style & WS_CHILD) && Wnd->IDMenu if (!(Wnd->style & WS_CHILD) && Wnd->IDMenu
&& (Menu = UserGetMenuObject((HMENU)Wnd->IDMenu))) && (Menu = UserGetMenuObject((HMENU)Wnd->IDMenu)))
{ {
IntDestroyMenuObject(Menu, TRUE, TRUE); IntDestroyMenuObject(Menu, TRUE, TRUE);
@ -486,10 +486,10 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
IntDestroyScrollBars(Window); IntDestroyScrollBars(Window);
/* dereference the class */ /* dereference the class */
IntDereferenceClass(Wnd->Class, IntDereferenceClass(Wnd->pcls,
Window->ti->pDeskInfo, Window->ti->pDeskInfo,
Window->ti->ppi); Window->ti->ppi);
Wnd->Class = NULL; Wnd->pcls = NULL;
if(Window->WindowRegion) if(Window->WindowRegion)
{ {
@ -510,19 +510,19 @@ VOID FASTCALL
IntGetWindowBorderMeasures(PWINDOW_OBJECT Window, UINT *cx, UINT *cy) IntGetWindowBorderMeasures(PWINDOW_OBJECT Window, UINT *cx, UINT *cy)
{ {
PWINDOW Wnd = Window->Wnd; PWINDOW Wnd = Window->Wnd;
if(HAS_DLGFRAME(Wnd->Style, Wnd->ExStyle) && !(Wnd->Style & WS_MINIMIZE)) if(HAS_DLGFRAME(Wnd->style, Wnd->ExStyle) && !(Wnd->style & WS_MINIMIZE))
{ {
*cx = UserGetSystemMetrics(SM_CXDLGFRAME); *cx = UserGetSystemMetrics(SM_CXDLGFRAME);
*cy = UserGetSystemMetrics(SM_CYDLGFRAME); *cy = UserGetSystemMetrics(SM_CYDLGFRAME);
} }
else else
{ {
if(HAS_THICKFRAME(Wnd->Style, Wnd->ExStyle)&& !(Wnd->Style & WS_MINIMIZE)) if(HAS_THICKFRAME(Wnd->style, Wnd->ExStyle)&& !(Wnd->style & WS_MINIMIZE))
{ {
*cx = UserGetSystemMetrics(SM_CXFRAME); *cx = UserGetSystemMetrics(SM_CXFRAME);
*cy = UserGetSystemMetrics(SM_CYFRAME); *cy = UserGetSystemMetrics(SM_CYFRAME);
} }
else if(HAS_THINFRAME(Wnd->Style, Wnd->ExStyle)) else if(HAS_THINFRAME(Wnd->style, Wnd->ExStyle))
{ {
*cx = UserGetSystemMetrics(SM_CXBORDER); *cx = UserGetSystemMetrics(SM_CXBORDER);
*cy = UserGetSystemMetrics(SM_CYBORDER); *cy = UserGetSystemMetrics(SM_CYBORDER);
@ -544,13 +544,13 @@ IntGetWindowProc(IN PWINDOW_OBJECT Window,
if (Wnd->IsSystem) if (Wnd->IsSystem)
{ {
return (Ansi ? Wnd->WndProcExtra : Wnd->WndProc); return (Ansi ? Wnd->WndProcExtra : Wnd->lpfnWndProc);
} }
else else
{ {
if (!Ansi == Wnd->Unicode) if (!Ansi == Wnd->Unicode)
{ {
return Wnd->WndProc; return Wnd->lpfnWndProc;
} }
else else
{ {
@ -564,13 +564,13 @@ IntGetWindowProc(IN PWINDOW_OBJECT Window,
{ {
PCALLPROC NewCallProc, CallProc; PCALLPROC NewCallProc, CallProc;
NewCallProc = UserFindCallProc(Wnd->Class, NewCallProc = UserFindCallProc(Wnd->pcls,
Wnd->WndProc, Wnd->lpfnWndProc,
Wnd->Unicode); Wnd->Unicode);
if (NewCallProc == NULL) if (NewCallProc == NULL)
{ {
NewCallProc = CreateCallProc(Wnd->ti->pDeskInfo, NewCallProc = CreateCallProc(Wnd->ti->pDeskInfo,
Wnd->WndProc, Wnd->lpfnWndProc,
Wnd->Unicode, Wnd->Unicode,
Wnd->ti->ppi); Wnd->ti->ppi);
if (NewCallProc == NULL) if (NewCallProc == NULL)
@ -579,7 +579,7 @@ IntGetWindowProc(IN PWINDOW_OBJECT Window,
return NULL; return NULL;
} }
UserAddCallProcToClass(Wnd->Class, UserAddCallProcToClass(Wnd->pcls,
NewCallProc); NewCallProc);
} }
@ -598,13 +598,13 @@ IntGetWindowInfo(PWINDOW_OBJECT Window, PWINDOWINFO pwi)
PWINDOW Wnd = Window->Wnd; PWINDOW Wnd = Window->Wnd;
pwi->cbSize = sizeof(WINDOWINFO); pwi->cbSize = sizeof(WINDOWINFO);
pwi->rcWindow = Window->Wnd->WindowRect; pwi->rcWindow = Window->Wnd->rcWindow;
pwi->rcClient = Window->Wnd->ClientRect; pwi->rcClient = Window->Wnd->rcClient;
pwi->dwStyle = Wnd->Style; pwi->dwStyle = Wnd->style;
pwi->dwExStyle = Wnd->ExStyle; pwi->dwExStyle = Wnd->ExStyle;
pwi->dwWindowStatus = (UserGetForegroundWindow() == Window->hSelf); /* WS_ACTIVECAPTION */ pwi->dwWindowStatus = (UserGetForegroundWindow() == Window->hSelf); /* WS_ACTIVECAPTION */
IntGetWindowBorderMeasures(Window, &pwi->cxWindowBorders, &pwi->cyWindowBorders); IntGetWindowBorderMeasures(Window, &pwi->cxWindowBorders, &pwi->cyWindowBorders);
pwi->atomWindowType = (Wnd->Class ? Wnd->Class->Atom : 0); pwi->atomWindowType = (Wnd->pcls ? Wnd->pcls->Atom : 0);
pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */ pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */
return TRUE; return TRUE;
} }
@ -618,7 +618,7 @@ IntSetMenu(
PMENU_OBJECT OldMenu, NewMenu = NULL; PMENU_OBJECT OldMenu, NewMenu = NULL;
PWINDOW Wnd = Window->Wnd; PWINDOW Wnd = Window->Wnd;
if ((Wnd->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD) if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{ {
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return FALSE; return FALSE;
@ -733,8 +733,8 @@ IntGetClientRect(PWINDOW_OBJECT Window, RECTL *Rect)
ASSERT( Rect ); ASSERT( Rect );
Rect->left = Rect->top = 0; Rect->left = Rect->top = 0;
Rect->right = Window->Wnd->ClientRect.right - Window->Wnd->ClientRect.left; Rect->right = Window->Wnd->rcClient.right - Window->Wnd->rcClient.left;
Rect->bottom = Window->Wnd->ClientRect.bottom - Window->Wnd->ClientRect.top; Rect->bottom = Window->Wnd->rcClient.bottom - Window->Wnd->rcClient.top;
} }
@ -880,7 +880,7 @@ IntIsChildWindow(PWINDOW_OBJECT Parent, PWINDOW_OBJECT BaseWindow)
{ {
return(TRUE); return(TRUE);
} }
if(!(Wnd->Style & WS_CHILD)) if(!(Wnd->style & WS_CHILD))
{ {
break; break;
} }
@ -901,11 +901,11 @@ IntIsWindowVisible(PWINDOW_OBJECT BaseWindow)
while(Window) while(Window)
{ {
Wnd = Window->Wnd; Wnd = Window->Wnd;
if(!(Wnd->Style & WS_CHILD)) if(!(Wnd->style & WS_CHILD))
{ {
break; break;
} }
if(!(Wnd->Style & WS_VISIBLE)) if(!(Wnd->style & WS_VISIBLE))
{ {
return FALSE; return FALSE;
} }
@ -913,7 +913,7 @@ IntIsWindowVisible(PWINDOW_OBJECT BaseWindow)
Window = Window->Parent; Window = Window->Parent;
} }
if(Window && Wnd->Style & WS_VISIBLE) if(Window && Wnd->style & WS_VISIBLE)
{ {
return TRUE; return TRUE;
} }
@ -933,7 +933,7 @@ IntLinkWindow(
PWINDOW_OBJECT Parent; PWINDOW_OBJECT Parent;
Wnd->Parent = WndParent; Wnd->Parent = WndParent;
Wnd->Wnd->Parent = WndParent ? WndParent->Wnd : NULL; Wnd->Wnd->spwndParent = WndParent ? WndParent->Wnd : NULL;
if ((Wnd->PrevSibling = WndPrevSibling)) if ((Wnd->PrevSibling = WndPrevSibling))
{ {
/* link after WndPrevSibling */ /* link after WndPrevSibling */
@ -990,12 +990,12 @@ IntSetOwner(HWND hWnd, HWND hWndNewOwner)
if((WndNewOwner = UserGetWindowObject(hWndNewOwner))) if((WndNewOwner = UserGetWindowObject(hWndNewOwner)))
{ {
Wnd->hOwner = hWndNewOwner; Wnd->hOwner = hWndNewOwner;
Wnd->Wnd->Owner = WndNewOwner->Wnd; Wnd->Wnd->spwndOwner = WndNewOwner->Wnd;
} }
else else
{ {
Wnd->hOwner = NULL; Wnd->hOwner = NULL;
Wnd->Wnd->Owner = NULL; Wnd->Wnd->spwndOwner = NULL;
} }
UserDereferenceObject(Wnd); UserDereferenceObject(Wnd);
@ -1140,7 +1140,7 @@ IntUnlinkWindow(PWINDOW_OBJECT Wnd)
Wnd->PrevSibling = Wnd->NextSibling = Wnd->Parent = NULL; Wnd->PrevSibling = Wnd->NextSibling = Wnd->Parent = NULL;
if (Wnd->Wnd) if (Wnd->Wnd)
Wnd->Wnd->Parent = NULL; Wnd->Wnd->spwndParent = NULL;
} }
BOOL FASTCALL BOOL FASTCALL
@ -1155,7 +1155,7 @@ IntAnyPopup(VOID)
for(Child = Window->FirstChild; Child; Child = Child->NextSibling) for(Child = Window->FirstChild; Child; Child = Child->NextSibling)
{ {
if(Child->hOwner && Child->Wnd->Style & WS_VISIBLE) if(Child->hOwner && Child->Wnd->style & WS_VISIBLE)
{ {
/* /*
* The desktop has a popup window if one of them has * The desktop has a popup window if one of them has
@ -1191,28 +1191,28 @@ IntGetWindowPlacement(PWINDOW_OBJECT Window, WINDOWPLACEMENT *lpwndpl)
} }
lpwndpl->flags = 0; lpwndpl->flags = 0;
if (0 == (Wnd->Style & WS_VISIBLE)) if (0 == (Wnd->style & WS_VISIBLE))
{ {
lpwndpl->showCmd = SW_HIDE; lpwndpl->showCmd = SW_HIDE;
} }
else if (0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) || else if (0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
0 != (Wnd->Style & WS_MAXIMIZE)) 0 != (Wnd->style & WS_MAXIMIZE))
{ {
lpwndpl->showCmd = SW_MAXIMIZE; lpwndpl->showCmd = SW_MAXIMIZE;
} }
else if (0 != (Wnd->Style & WS_MINIMIZE)) else if (0 != (Wnd->style & WS_MINIMIZE))
{ {
lpwndpl->showCmd = SW_MINIMIZE; lpwndpl->showCmd = SW_MINIMIZE;
} }
else if (0 != (Wnd->Style & WS_VISIBLE)) else if (0 != (Wnd->style & WS_VISIBLE))
{ {
lpwndpl->showCmd = SW_SHOWNORMAL; lpwndpl->showCmd = SW_SHOWNORMAL;
} }
Size.x = Wnd->WindowRect.left; Size.x = Wnd->rcWindow.left;
Size.y = Wnd->WindowRect.top; Size.y = Wnd->rcWindow.top;
WinPosInitInternalPos(Window, &Size, WinPosInitInternalPos(Window, &Size,
&Wnd->WindowRect); &Wnd->rcWindow);
lpwndpl->rcNormalPosition = Wnd->InternalPos.NormalRect; lpwndpl->rcNormalPosition = Wnd->InternalPos.NormalRect;
lpwndpl->ptMinPosition = Wnd->InternalPos.IconPos; lpwndpl->ptMinPosition = Wnd->InternalPos.IconPos;
@ -1423,8 +1423,8 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
if(Parent->hSelf != IntGetDesktopWindow()) if(Parent->hSelf != IntGetDesktopWindow())
{ {
Pt.x += Parent->Wnd->ClientRect.left; Pt.x += Parent->Wnd->rcClient.left;
Pt.y += Parent->Wnd->ClientRect.top; Pt.y += Parent->Wnd->rcClient.top;
} }
if(!IntPtInWindow(Parent, Pt.x, Pt.y)) if(!IntPtInWindow(Parent, Pt.x, Pt.y))
@ -1442,11 +1442,11 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
if((Child = UserGetWindowObject(*phWnd))) if((Child = UserGetWindowObject(*phWnd)))
{ {
ChildWnd = Child->Wnd; ChildWnd = Child->Wnd;
if(!(ChildWnd->Style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE)) if(!(ChildWnd->style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE))
{ {
continue; continue;
} }
if((ChildWnd->Style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED)) if((ChildWnd->style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED))
{ {
continue; continue;
} }
@ -1479,7 +1479,7 @@ IntCalcDefPosSize(PWINDOW_OBJECT Parent, PWINDOW_OBJECT Window, RECTL *rc, BOOL
if(Parent != NULL) if(Parent != NULL)
{ {
RECTL_bIntersectRect(rc, rc, &Parent->Wnd->ClientRect); RECTL_bIntersectRect(rc, rc, &Parent->Wnd->rcClient);
if(IncPos) if(IncPos)
{ {
@ -1702,41 +1702,41 @@ AllocErr:
* Fill out the structure describing it. * Fill out the structure describing it.
*/ */
Window->ti = ti; Window->ti = ti;
Wnd->Class = Class; Wnd->pcls = Class;
Class = NULL; Class = NULL;
Window->SystemMenu = (HMENU)0; Window->SystemMenu = (HMENU)0;
Wnd->ContextHelpId = 0; Wnd->ContextHelpId = 0;
Wnd->IDMenu = 0; Wnd->IDMenu = 0;
Wnd->Instance = hInstance; Wnd->hModule = hInstance;
Window->hSelf = hWnd; Window->hSelf = hWnd;
Window->MessageQueue = pti->MessageQueue; Window->MessageQueue = pti->MessageQueue;
IntReferenceMessageQueue(Window->MessageQueue); IntReferenceMessageQueue(Window->MessageQueue);
Window->Parent = ParentWindow; Window->Parent = ParentWindow;
Wnd->Parent = ParentWindow ? ParentWindow->Wnd : NULL; Wnd->spwndParent = ParentWindow ? ParentWindow->Wnd : NULL;
if (Wnd->Parent != NULL && hWndParent != 0) if (Wnd->spwndParent != NULL && hWndParent != 0)
{ {
Wnd->HideFocus = Wnd->Parent->HideFocus; Wnd->HideFocus = Wnd->spwndParent->HideFocus;
Wnd->HideAccel = Wnd->Parent->HideAccel; Wnd->HideAccel = Wnd->spwndParent->HideAccel;
} }
if((OwnerWindow = UserGetWindowObject(OwnerWindowHandle))) if((OwnerWindow = UserGetWindowObject(OwnerWindowHandle)))
{ {
Window->hOwner = OwnerWindowHandle; Window->hOwner = OwnerWindowHandle;
Wnd->Owner = OwnerWindow->Wnd; Wnd->spwndOwner = OwnerWindow->Wnd;
HasOwner = TRUE; HasOwner = TRUE;
} }
else else
{ {
Window->hOwner = NULL; Window->hOwner = NULL;
Wnd->Owner = NULL; Wnd->spwndOwner = NULL;
HasOwner = FALSE; HasOwner = FALSE;
} }
Wnd->UserData = 0; Wnd->dwUserData = 0;
Wnd->IsSystem = Wnd->Class->System; Wnd->IsSystem = Wnd->pcls->System;
/* BugBoy Comments: Comment below say that System classes are always created as UNICODE. /* BugBoy Comments: Comment below say that System classes are always created as UNICODE.
In windows, creating a window with the ANSI version of CreateWindow sets the window In windows, creating a window with the ANSI version of CreateWindow sets the window
@ -1745,17 +1745,17 @@ AllocErr:
No where can I see in code or through testing does the window change back to ANSI No where can I see in code or through testing does the window change back to ANSI
after being created as UNICODE in ROS. I didnt do more testing to see what problems this would cause.*/ after being created as UNICODE in ROS. I didnt do more testing to see what problems this would cause.*/
// See NtUserDefSetText! We convert to Unicode all the time and never use Mix. (jt) // See NtUserDefSetText! We convert to Unicode all the time and never use Mix. (jt)
if (Wnd->Class->System) if (Wnd->pcls->System)
{ {
/* NOTE: Always create a unicode window for system classes! */ /* NOTE: Always create a unicode window for system classes! */
Wnd->Unicode = TRUE; Wnd->Unicode = TRUE;
Wnd->WndProc = Wnd->Class->WndProc; Wnd->lpfnWndProc = Wnd->pcls->WndProc;
Wnd->WndProcExtra = Wnd->Class->WndProcExtra; Wnd->WndProcExtra = Wnd->pcls->WndProcExtra;
} }
else else
{ {
Wnd->Unicode = Wnd->Class->Unicode; Wnd->Unicode = Wnd->pcls->Unicode;
Wnd->WndProc = Wnd->Class->WndProc; Wnd->lpfnWndProc = Wnd->pcls->WndProc;
Wnd->CallProc = NULL; Wnd->CallProc = NULL;
} }
@ -1764,33 +1764,33 @@ AllocErr:
Window->LastChild = NULL; Window->LastChild = NULL;
Window->PrevSibling = NULL; Window->PrevSibling = NULL;
Window->NextSibling = NULL; Window->NextSibling = NULL;
Wnd->ExtraDataSize = Wnd->Class->WndExtra; Wnd->cbwndExtra = Wnd->pcls->WndExtra;
InitializeListHead(&Wnd->PropListHead); InitializeListHead(&Wnd->PropListHead);
InitializeListHead(&Window->WndObjListHead); InitializeListHead(&Window->WndObjListHead);
if ( NULL != WindowName->Buffer && WindowName->Length > 0 ) if ( NULL != WindowName->Buffer && WindowName->Length > 0 )
{ {
Wnd->WindowName.Buffer = DesktopHeapAlloc(Wnd->pdesktop, Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->pdesktop,
WindowName->Length + sizeof(UNICODE_NULL)); WindowName->Length + sizeof(UNICODE_NULL));
if (Wnd->WindowName.Buffer == NULL) if (Wnd->strName.Buffer == NULL)
{ {
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
RETURN( (PWINDOW)0); RETURN( (PWINDOW)0);
} }
Wnd->WindowName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0'; Wnd->strName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0';
_SEH2_TRY _SEH2_TRY
{ {
RtlCopyMemory(Wnd->WindowName.Buffer, RtlCopyMemory(Wnd->strName.Buffer,
WindowName->Buffer, WindowName->Buffer,
WindowName->Length); WindowName->Length);
Wnd->WindowName.Length = WindowName->Length; Wnd->strName.Length = WindowName->Length;
} }
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{ {
WindowName->Length = 0; WindowName->Length = 0;
Wnd->WindowName.Buffer[0] = L'\0'; Wnd->strName.Buffer[0] = L'\0';
} }
_SEH2_END; _SEH2_END;
} }
@ -1837,7 +1837,7 @@ AllocErr:
IntSetMenu(Window, hMenu, &MenuChanged); IntSetMenu(Window, hMenu, &MenuChanged);
else else
{ {
hMenu = Wnd->Class->hMenu; hMenu = Wnd->pcls->hMenu;
if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged); if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
} }
} }
@ -1848,10 +1848,10 @@ AllocErr:
InsertTailList (&pti->WindowListHead, &Window->ThreadListEntry); InsertTailList (&pti->WindowListHead, &Window->ThreadListEntry);
/* Handle "CS_CLASSDC", it is tested first. */ /* Handle "CS_CLASSDC", it is tested first. */
if ((Wnd->Class->Style & CS_CLASSDC) && !(Wnd->Class->Dce)) // One DCE per class to have CLASS. if ((Wnd->pcls->Style & CS_CLASSDC) && !(Wnd->pcls->Dce)) // One DCE per class to have CLASS.
Wnd->Class->Dce = DceAllocDCE(Window, DCE_CLASS_DC); Wnd->pcls->Dce = DceAllocDCE(Window, DCE_CLASS_DC);
/* Allocate a DCE for this window. */ /* Allocate a DCE for this window. */
else if ( Wnd->Class->Style & CS_OWNDC) else if ( Wnd->pcls->Style & CS_OWNDC)
Window->Dce = DceAllocDCE(Window, DCE_WINDOW_DC); Window->Dce = DceAllocDCE(Window, DCE_WINDOW_DC);
Pos.x = x; Pos.x = x;
@ -1860,7 +1860,7 @@ AllocErr:
Size.cy = nHeight; Size.cy = nHeight;
Wnd->ExStyle = dwExStyle; Wnd->ExStyle = dwExStyle;
Wnd->Style = dwStyle & ~WS_VISIBLE; Wnd->style = dwStyle & ~WS_VISIBLE;
/* call hook */ /* call hook */
Cs.lpCreateParams = lpParam; Cs.lpCreateParams = lpParam;
@ -1871,7 +1871,7 @@ AllocErr:
Cs.cy = Size.cy; Cs.cy = Size.cy;
Cs.x = Pos.x; Cs.x = Pos.x;
Cs.y = Pos.y; Cs.y = Pos.y;
Cs.style = Wnd->Style; Cs.style = Wnd->style;
// Cs.lpszName = (LPCWSTR) WindowName->Buffer; // Cs.lpszName = (LPCWSTR) WindowName->Buffer;
// Cs.lpszClass = (LPCWSTR) ClassName->Buffer; // Cs.lpszClass = (LPCWSTR) ClassName->Buffer;
Cs.lpszName = (LPCWSTR) WindowName; Cs.lpszName = (LPCWSTR) WindowName;
@ -1897,7 +1897,7 @@ AllocErr:
// hwndInsertAfter = CbtCreate.hwndInsertAfter; // hwndInsertAfter = CbtCreate.hwndInsertAfter;
/* default positioning for overlapped windows */ /* default positioning for overlapped windows */
if(!(Wnd->Style & (WS_POPUP | WS_CHILD))) if(!(Wnd->style & (WS_POPUP | WS_CHILD)))
{ {
RECTL rc, WorkArea; RECTL rc, WorkArea;
PRTL_USER_PROCESS_PARAMETERS ProcessParams; PRTL_USER_PROCESS_PARAMETERS ProcessParams;
@ -1991,16 +1991,16 @@ AllocErr:
} }
/* Initialize the window dimensions. */ /* Initialize the window dimensions. */
Wnd->WindowRect.left = Pos.x; Wnd->rcWindow.left = Pos.x;
Wnd->WindowRect.top = Pos.y; Wnd->rcWindow.top = Pos.y;
Wnd->WindowRect.right = Pos.x + Size.cx; Wnd->rcWindow.right = Pos.x + Size.cx;
Wnd->WindowRect.bottom = Pos.y + Size.cy; Wnd->rcWindow.bottom = Pos.y + Size.cy;
if (0 != (Wnd->Style & WS_CHILD) && ParentWindow) if (0 != (Wnd->style & WS_CHILD) && ParentWindow)
{ {
RECTL_vOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left, RECTL_vOffsetRect(&(Wnd->rcWindow), ParentWindow->Wnd->rcClient.left,
ParentWindow->Wnd->ClientRect.top); ParentWindow->Wnd->rcClient.top);
} }
Wnd->ClientRect = Wnd->WindowRect; Wnd->rcClient = Wnd->rcWindow;
/* /*
* Get the size and position of the window. * Get the size and position of the window.
@ -2026,16 +2026,16 @@ AllocErr:
Size.cy = 0; Size.cy = 0;
} }
Wnd->WindowRect.left = Pos.x; Wnd->rcWindow.left = Pos.x;
Wnd->WindowRect.top = Pos.y; Wnd->rcWindow.top = Pos.y;
Wnd->WindowRect.right = Pos.x + Size.cx; Wnd->rcWindow.right = Pos.x + Size.cx;
Wnd->WindowRect.bottom = Pos.y + Size.cy; Wnd->rcWindow.bottom = Pos.y + Size.cy;
if (0 != (Wnd->Style & WS_CHILD) && ParentWindow) if (0 != (Wnd->style & WS_CHILD) && ParentWindow)
{ {
RECTL_vOffsetRect(&(Wnd->WindowRect), ParentWindow->Wnd->ClientRect.left, RECTL_vOffsetRect(&(Wnd->rcWindow), ParentWindow->Wnd->rcClient.left,
ParentWindow->Wnd->ClientRect.top); ParentWindow->Wnd->rcClient.top);
} }
Wnd->ClientRect = Wnd->WindowRect; Wnd->rcClient = Wnd->rcWindow;
/* FIXME: Initialize the window menu. */ /* FIXME: Initialize the window menu. */
@ -2057,19 +2057,19 @@ AllocErr:
} }
/* Calculate the non-client size. */ /* Calculate the non-client size. */
MaxPos.x = Window->Wnd->WindowRect.left; MaxPos.x = Window->Wnd->rcWindow.left;
MaxPos.y = Window->Wnd->WindowRect.top; MaxPos.y = Window->Wnd->rcWindow.top;
DPRINT("IntCreateWindowEx(): About to get non-client size.\n"); DPRINT("IntCreateWindowEx(): About to get non-client size.\n");
/* WinPosGetNonClientSize SENDS THE WM_NCCALCSIZE message */ /* WinPosGetNonClientSize SENDS THE WM_NCCALCSIZE message */
Result = co_WinPosGetNonClientSize(Window, Result = co_WinPosGetNonClientSize(Window,
&Window->Wnd->WindowRect, &Window->Wnd->rcWindow,
&Window->Wnd->ClientRect); &Window->Wnd->rcClient);
RECTL_vOffsetRect(&Window->Wnd->WindowRect, RECTL_vOffsetRect(&Window->Wnd->rcWindow,
MaxPos.x - Window->Wnd->WindowRect.left, MaxPos.x - Window->Wnd->rcWindow.left,
MaxPos.y - Window->Wnd->WindowRect.top); MaxPos.y - Window->Wnd->rcWindow.top);
if (NULL != ParentWindow) if (NULL != ParentWindow)
@ -2129,30 +2129,30 @@ AllocErr:
DPRINT("IntCreateWindow(): About to send WM_SIZE\n"); DPRINT("IntCreateWindow(): About to send WM_SIZE\n");
if ((Window->Wnd->ClientRect.right - Window->Wnd->ClientRect.left) < 0 || if ((Window->Wnd->rcClient.right - Window->Wnd->rcClient.left) < 0 ||
(Window->Wnd->ClientRect.bottom - Window->Wnd->ClientRect.top) < 0) (Window->Wnd->rcClient.bottom - Window->Wnd->rcClient.top) < 0)
{ {
DPRINT("Sending bogus WM_SIZE\n"); DPRINT("Sending bogus WM_SIZE\n");
} }
lParam = MAKE_LONG(Window->Wnd->ClientRect.right - lParam = MAKE_LONG(Window->Wnd->rcClient.right -
Window->Wnd->ClientRect.left, Window->Wnd->rcClient.left,
Window->Wnd->ClientRect.bottom - Window->Wnd->rcClient.bottom -
Window->Wnd->ClientRect.top); Window->Wnd->rcClient.top);
co_IntSendMessage(Window->hSelf, WM_SIZE, SIZE_RESTORED, co_IntSendMessage(Window->hSelf, WM_SIZE, SIZE_RESTORED,
lParam); lParam);
DPRINT("IntCreateWindow(): About to send WM_MOVE\n"); DPRINT("IntCreateWindow(): About to send WM_MOVE\n");
if (0 != (Wnd->Style & WS_CHILD) && ParentWindow) if (0 != (Wnd->style & WS_CHILD) && ParentWindow)
{ {
lParam = MAKE_LONG(Wnd->ClientRect.left - ParentWindow->Wnd->ClientRect.left, lParam = MAKE_LONG(Wnd->rcClient.left - ParentWindow->Wnd->rcClient.left,
Wnd->ClientRect.top - ParentWindow->Wnd->ClientRect.top); Wnd->rcClient.top - ParentWindow->Wnd->rcClient.top);
} }
else else
{ {
lParam = MAKE_LONG(Wnd->ClientRect.left, lParam = MAKE_LONG(Wnd->rcClient.left,
Wnd->ClientRect.top); Wnd->rcClient.top);
} }
co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam); co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam);
@ -2162,17 +2162,17 @@ AllocErr:
} }
/* Show or maybe minimize or maximize the window. */ /* Show or maybe minimize or maximize the window. */
if (Wnd->Style & (WS_MINIMIZE | WS_MAXIMIZE)) if (Wnd->style & (WS_MINIMIZE | WS_MAXIMIZE))
{ {
RECTL NewPos; RECTL NewPos;
UINT16 SwFlag; UINT16 SwFlag;
SwFlag = (Wnd->Style & WS_MINIMIZE) ? SW_MINIMIZE : SwFlag = (Wnd->style & WS_MINIMIZE) ? SW_MINIMIZE :
SW_MAXIMIZE; SW_MAXIMIZE;
co_WinPosMinMaximize(Window, SwFlag, &NewPos); co_WinPosMinMaximize(Window, SwFlag, &NewPos);
SwFlag = ((Wnd->Style & WS_CHILD) || UserGetActiveWindow()) ? SwFlag = ((Wnd->style & WS_CHILD) || UserGetActiveWindow()) ?
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED : SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED :
SWP_NOZORDER | SWP_FRAMECHANGED; SWP_NOZORDER | SWP_FRAMECHANGED;
@ -2183,7 +2183,7 @@ AllocErr:
} }
/* Notify the parent window of a new child. */ /* Notify the parent window of a new child. */
if ((Wnd->Style & WS_CHILD) && if ((Wnd->style & WS_CHILD) &&
(!(Wnd->ExStyle & WS_EX_NOPARENTNOTIFY)) && ParentWindow) (!(Wnd->ExStyle & WS_EX_NOPARENTNOTIFY)) && ParentWindow)
{ {
DPRINT("IntCreateWindow(): About to notify parent\n"); DPRINT("IntCreateWindow(): About to notify parent\n");
@ -2204,20 +2204,20 @@ AllocErr:
} }
/* Initialize and show the window's scrollbars */ /* Initialize and show the window's scrollbars */
if (Wnd->Style & WS_VSCROLL) if (Wnd->style & WS_VSCROLL)
{ {
co_UserShowScrollBar(Window, SB_VERT, TRUE); co_UserShowScrollBar(Window, SB_VERT, TRUE);
} }
if (Wnd->Style & WS_HSCROLL) if (Wnd->style & WS_HSCROLL)
{ {
co_UserShowScrollBar(Window, SB_HORZ, TRUE); co_UserShowScrollBar(Window, SB_HORZ, TRUE);
} }
if (dwStyle & WS_VISIBLE) if (dwStyle & WS_VISIBLE)
{ {
if (Wnd->Style & WS_MAXIMIZE) if (Wnd->style & WS_MAXIMIZE)
dwShowMode = SW_SHOW; dwShowMode = SW_SHOW;
else if (Wnd->Style & WS_MINIMIZE) else if (Wnd->style & WS_MINIMIZE)
dwShowMode = SW_SHOWMINIMIZED; dwShowMode = SW_SHOWMINIMIZED;
DPRINT("IntCreateWindow(): About to show window\n"); DPRINT("IntCreateWindow(): About to show window\n");
@ -2237,8 +2237,8 @@ AllocErr:
if (ClassAtom == gpsi->atomSysClass[ICLS_EDIT]) if (ClassAtom == gpsi->atomSysClass[ICLS_EDIT])
{ {
PCALLPROC CallProc; PCALLPROC CallProc;
//CallProc = CreateCallProc(NULL, Wnd->WndProc, bUnicodeWindow, Wnd->ti->ppi); //CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, bUnicodeWindow, Wnd->ti->ppi);
CallProc = CreateCallProc(NULL, Wnd->WndProc, Wnd->Unicode , Wnd->ti->ppi); CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, Wnd->Unicode , Wnd->ti->ppi);
if (!CallProc) if (!CallProc)
{ {
@ -2247,7 +2247,7 @@ AllocErr:
} }
else else
{ {
UserAddCallProcToClass(Wnd->Class, CallProc); UserAddCallProcToClass(Wnd->pcls, CallProc);
Wnd->CallProc = CallProc; Wnd->CallProc = CallProc;
Wnd->IsSystem = FALSE; Wnd->IsSystem = FALSE;
} }
@ -2447,7 +2447,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
IntDereferenceMessageQueue(Window->MessageQueue); IntDereferenceMessageQueue(Window->MessageQueue);
IntEngWindowChanged(Window, WOC_DELETE); IntEngWindowChanged(Window, WOC_DELETE);
isChild = (0 != (Wnd->Style & WS_CHILD)); isChild = (0 != (Wnd->style & WS_CHILD));
#if 0 /* FIXME */ #if 0 /* FIXME */
@ -2510,7 +2510,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
if (Child->hOwner != NULL) if (Child->hOwner != NULL)
{ {
Child->hOwner = NULL; Child->hOwner = NULL;
Child->Wnd->Owner = NULL; Child->Wnd->spwndOwner = NULL;
} }
} }
@ -2655,8 +2655,8 @@ IntFindWindow(PWINDOW_OBJECT Parent,
/* Do not send WM_GETTEXT messages in the kernel mode version! /* Do not send WM_GETTEXT messages in the kernel mode version!
The user mode version however calls GetWindowText() which will The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */ send WM_GETTEXT messages to windows belonging to its processes */
if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->Wnd->WindowName), TRUE)) && if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->Wnd->strName), TRUE)) &&
(!ClassAtom || Child->Wnd->Class->Atom == ClassAtom)) (!ClassAtom || Child->Wnd->pcls->Atom == ClassAtom))
{ {
Ret = Child->hSelf; Ret = Child->hSelf;
break; break;
@ -2827,9 +2827,9 @@ NtUserFindWindowEx(HWND hwndParent,
The user mode version however calls GetWindowText() which will The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */ send WM_GETTEXT messages to windows belonging to its processes */
WindowMatches = !CheckWindowName || !RtlCompareUnicodeString( WindowMatches = !CheckWindowName || !RtlCompareUnicodeString(
&WindowName, &TopLevelWindow->Wnd->WindowName, TRUE); &WindowName, &TopLevelWindow->Wnd->strName, TRUE);
ClassMatches = (ClassAtom == (RTL_ATOM)0) || ClassMatches = (ClassAtom == (RTL_ATOM)0) ||
ClassAtom == TopLevelWindow->Wnd->Class->Atom; ClassAtom == TopLevelWindow->Wnd->pcls->Atom;
if (WindowMatches && ClassMatches) if (WindowMatches && ClassMatches)
{ {
@ -3596,7 +3596,7 @@ UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi)
if ((INT)Index >= 0) if ((INT)Index >= 0)
{ {
if ((Index + sizeof(LONG)) > Window->Wnd->ExtraDataSize) if ((Index + sizeof(LONG)) > Window->Wnd->cbwndExtra)
{ {
SetLastWin32Error(ERROR_INVALID_PARAMETER); SetLastWin32Error(ERROR_INVALID_PARAMETER);
return 0; return 0;
@ -3612,7 +3612,7 @@ UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi)
break; break;
case GWL_STYLE: case GWL_STYLE:
Result = Wnd->Style; Result = Wnd->style;
break; break;
case GWL_WNDPROC: case GWL_WNDPROC:
@ -3621,7 +3621,7 @@ UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi)
break; break;
case GWL_HINSTANCE: case GWL_HINSTANCE:
Result = (LONG) Wnd->Instance; Result = (LONG) Wnd->hModule;
break; break;
case GWL_HWNDPARENT: case GWL_HWNDPARENT:
@ -3640,7 +3640,7 @@ UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi)
break; break;
case GWL_USERDATA: case GWL_USERDATA:
Result = Wnd->UserData; Result = Wnd->dwUserData;
break; break;
default: default:
@ -3709,23 +3709,23 @@ IntSetWindowProc(PWINDOW_OBJECT Window,
/* attempt to get the previous window proc */ /* attempt to get the previous window proc */
if (Wnd->IsSystem) if (Wnd->IsSystem)
{ {
Ret = (Ansi ? Wnd->WndProcExtra : Wnd->WndProc); Ret = (Ansi ? Wnd->WndProcExtra : Wnd->lpfnWndProc);
} }
else else
{ {
if (!Ansi == Wnd->Unicode) if (!Ansi == Wnd->Unicode)
{ {
Ret = Wnd->WndProc; Ret = Wnd->lpfnWndProc;
} }
else else
{ {
CallProc = UserFindCallProc(Wnd->Class, CallProc = UserFindCallProc(Wnd->pcls,
Wnd->WndProc, Wnd->lpfnWndProc,
Wnd->Unicode); Wnd->Unicode);
if (CallProc == NULL) if (CallProc == NULL)
{ {
CallProc = CreateCallProc(NULL, CallProc = CreateCallProc(NULL,
Wnd->WndProc, Wnd->lpfnWndProc,
Wnd->Unicode, Wnd->Unicode,
Wnd->ti->ppi); Wnd->ti->ppi);
if (CallProc == NULL) if (CallProc == NULL)
@ -3734,13 +3734,13 @@ IntSetWindowProc(PWINDOW_OBJECT Window,
return NULL; return NULL;
} }
UserAddCallProcToClass(Wnd->Class, UserAddCallProcToClass(Wnd->pcls,
CallProc); CallProc);
} }
/* BugBoy Comments: Added this if else, see below comments */ /* BugBoy Comments: Added this if else, see below comments */
if (!Wnd->CallProc) if (!Wnd->CallProc)
{ {
Ret = Wnd->WndProc; Ret = Wnd->lpfnWndProc;
} }
else else
{ {
@ -3756,17 +3756,17 @@ IntSetWindowProc(PWINDOW_OBJECT Window,
} }
} }
if (Wnd->Class->System) if (Wnd->pcls->System)
{ {
/* check if the new procedure matches with the one in the /* check if the new procedure matches with the one in the
window class. If so, we need to restore both procedures! */ window class. If so, we need to restore both procedures! */
Wnd->IsSystem = (NewWndProc == Wnd->Class->WndProc || Wnd->IsSystem = (NewWndProc == Wnd->pcls->WndProc ||
NewWndProc == Wnd->Class->WndProcExtra); NewWndProc == Wnd->pcls->WndProcExtra);
if (Wnd->IsSystem) if (Wnd->IsSystem)
{ {
Wnd->WndProc = Wnd->Class->WndProc; Wnd->lpfnWndProc = Wnd->pcls->WndProc;
Wnd->WndProcExtra = Wnd->Class->WndProcExtra; Wnd->WndProcExtra = Wnd->pcls->WndProcExtra;
Wnd->Unicode = !Ansi; Wnd->Unicode = !Ansi;
return Ret; return Ret;
} }
@ -3775,7 +3775,7 @@ IntSetWindowProc(PWINDOW_OBJECT Window,
ASSERT(!Wnd->IsSystem); ASSERT(!Wnd->IsSystem);
/* update the window procedure */ /* update the window procedure */
Wnd->WndProc = NewWndProc; Wnd->lpfnWndProc = NewWndProc;
Wnd->Unicode = !Ansi; Wnd->Unicode = !Ansi;
return Ret; return Ret;
@ -3808,7 +3808,7 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
if ((INT)Index >= 0) if ((INT)Index >= 0)
{ {
if ((Index + sizeof(LONG)) > Wnd->ExtraDataSize) if ((Index + sizeof(LONG)) > Wnd->cbwndExtra)
{ {
SetLastWin32Error(ERROR_INVALID_PARAMETER); SetLastWin32Error(ERROR_INVALID_PARAMETER);
return( 0); return( 0);
@ -3841,11 +3841,11 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
break; break;
case GWL_STYLE: case GWL_STYLE:
OldValue = (LONG) Wnd->Style; OldValue = (LONG) Wnd->style;
Style.styleOld = OldValue; Style.styleOld = OldValue;
Style.styleNew = NewValue; Style.styleNew = NewValue;
co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style); co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style);
Wnd->Style = (DWORD)Style.styleNew; Wnd->style = (DWORD)Style.styleNew;
co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM) &Style); co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM) &Style);
break; break;
@ -3859,8 +3859,8 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
} }
case GWL_HINSTANCE: case GWL_HINSTANCE:
OldValue = (LONG) Wnd->Instance; OldValue = (LONG) Wnd->hModule;
Wnd->Instance = (HINSTANCE) NewValue; Wnd->hModule = (HINSTANCE) NewValue;
break; break;
case GWL_HWNDPARENT: case GWL_HWNDPARENT:
@ -3877,8 +3877,8 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
break; break;
case GWL_USERDATA: case GWL_USERDATA:
OldValue = Wnd->UserData; OldValue = Wnd->dwUserData;
Wnd->UserData = NewValue; Wnd->dwUserData = NewValue;
break; break;
default: default:
@ -3959,7 +3959,7 @@ NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue)
} }
} }
if (Index > Window->Wnd->ExtraDataSize - sizeof(WORD)) if (Index > Window->Wnd->cbwndExtra - sizeof(WORD))
{ {
SetLastWin32Error(ERROR_INVALID_PARAMETER); SetLastWin32Error(ERROR_INVALID_PARAMETER);
RETURN( 0); RETURN( 0);
@ -4011,29 +4011,29 @@ NtUserGetWindowPlacement(HWND hWnd,
} }
Safepl.flags = 0; Safepl.flags = 0;
if (0 == (Wnd->Style & WS_VISIBLE)) if (0 == (Wnd->style & WS_VISIBLE))
{ {
Safepl.showCmd = SW_HIDE; Safepl.showCmd = SW_HIDE;
} }
else if ((0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) || else if ((0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) ||
0 != (Wnd->Style & WS_MAXIMIZE)) && 0 != (Wnd->style & WS_MAXIMIZE)) &&
0 == (Wnd->Style & WS_MINIMIZE)) 0 == (Wnd->style & WS_MINIMIZE))
{ {
Safepl.showCmd = SW_SHOWMAXIMIZED; Safepl.showCmd = SW_SHOWMAXIMIZED;
} }
else if (0 != (Wnd->Style & WS_MINIMIZE)) else if (0 != (Wnd->style & WS_MINIMIZE))
{ {
Safepl.showCmd = SW_SHOWMINIMIZED; Safepl.showCmd = SW_SHOWMINIMIZED;
} }
else if (0 != (Wnd->Style & WS_VISIBLE)) else if (0 != (Wnd->style & WS_VISIBLE))
{ {
Safepl.showCmd = SW_SHOWNORMAL; Safepl.showCmd = SW_SHOWNORMAL;
} }
Size.x = Wnd->WindowRect.left; Size.x = Wnd->rcWindow.left;
Size.y = Wnd->WindowRect.top; Size.y = Wnd->rcWindow.top;
WinPosInitInternalPos(Window, &Size, WinPosInitInternalPos(Window, &Size,
&Wnd->WindowRect); &Wnd->rcWindow);
Safepl.rcNormalPosition = Wnd->InternalPos.NormalRect; Safepl.rcNormalPosition = Wnd->InternalPos.NormalRect;
Safepl.ptMinPosition = Wnd->InternalPos.IconPos; Safepl.ptMinPosition = Wnd->InternalPos.IconPos;
@ -4327,14 +4327,14 @@ NtUserSetWindowFNID(HWND hWnd,
} }
Wnd = Window->Wnd; Wnd = Window->Wnd;
if (Wnd->Class) if (Wnd->pcls)
{ // From user land we only set these. { // From user land we only set these.
if ((fnID != FNID_DESTROY) || ((fnID < FNID_BUTTON) && (fnID > FNID_IME)) ) if ((fnID != FNID_DESTROY) || ((fnID < FNID_BUTTON) && (fnID > FNID_IME)) )
{ {
RETURN( FALSE); RETURN( FALSE);
} }
else else
Wnd->Class->fnID |= fnID; Wnd->pcls->fnID |= fnID;
} }
RETURN( TRUE); RETURN( TRUE);
@ -4381,7 +4381,7 @@ NtUserSetWindowPlacement(HWND hWnd,
UserRefObjectCo(Window, &Ref); UserRefObjectCo(Window, &Ref);
if ((Wnd->Style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0) if ((Wnd->style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0)
{ {
co_WinPosSetWindowPos(Window, NULL, co_WinPosSetWindowPos(Window, NULL,
Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.top, Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.top,
@ -4483,10 +4483,10 @@ IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn)
Wnd = Window->Wnd; Wnd = Window->Wnd;
/* Create a new window region using the window rectangle */ /* Create a new window region using the window rectangle */
VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect); VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
NtGdiOffsetRgn(VisRgn, -Window->Wnd->WindowRect.left, -Window->Wnd->WindowRect.top); NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
/* if there's a region assigned to the window, combine them both */ /* if there's a region assigned to the window, combine them both */
if(Window->WindowRegion && !(Wnd->Style & WS_MINIMIZE)) if(Window->WindowRegion && !(Wnd->style & WS_MINIMIZE))
NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND); NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND);
/* Copy the region into hRgn */ /* Copy the region into hRgn */
NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY); NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY);
@ -4524,10 +4524,10 @@ IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect)
Wnd = Window->Wnd; Wnd = Window->Wnd;
/* Create a new window region using the window rectangle */ /* Create a new window region using the window rectangle */
VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect); VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->rcWindow);
NtGdiOffsetRgn(VisRgn, -Window->Wnd->WindowRect.left, -Window->Wnd->WindowRect.top); NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
/* if there's a region assigned to the window, combine them both */ /* if there's a region assigned to the window, combine them both */
if(Window->WindowRegion && !(Wnd->Style & WS_MINIMIZE)) if(Window->WindowRegion && !(Wnd->style & WS_MINIMIZE))
NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND); NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND);
if((pRgn = REGION_LockRgn(VisRgn))) if((pRgn = REGION_LockRgn(VisRgn)))
@ -4798,38 +4798,38 @@ NtUserDefSetText(HWND hWnd, PLARGE_STRING WindowText)
if (UnicodeString.Length != 0) if (UnicodeString.Length != 0)
{ {
if (Wnd->WindowName.MaximumLength > 0 && if (Wnd->strName.MaximumLength > 0 &&
UnicodeString.Length <= Wnd->WindowName.MaximumLength - sizeof(UNICODE_NULL)) UnicodeString.Length <= Wnd->strName.MaximumLength - sizeof(UNICODE_NULL))
{ {
ASSERT(Wnd->WindowName.Buffer != NULL); ASSERT(Wnd->strName.Buffer != NULL);
Wnd->WindowName.Length = UnicodeString.Length; Wnd->strName.Length = UnicodeString.Length;
Wnd->WindowName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0'; Wnd->strName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0';
RtlCopyMemory(Wnd->WindowName.Buffer, RtlCopyMemory(Wnd->strName.Buffer,
UnicodeString.Buffer, UnicodeString.Buffer,
UnicodeString.Length); UnicodeString.Length);
} }
else else
{ {
PWCHAR buf; PWCHAR buf;
Wnd->WindowName.MaximumLength = Wnd->WindowName.Length = 0; Wnd->strName.MaximumLength = Wnd->strName.Length = 0;
buf = Wnd->WindowName.Buffer; buf = Wnd->strName.Buffer;
Wnd->WindowName.Buffer = NULL; Wnd->strName.Buffer = NULL;
if (buf != NULL) if (buf != NULL)
{ {
DesktopHeapFree(Wnd->pdesktop, buf); DesktopHeapFree(Wnd->pdesktop, buf);
} }
Wnd->WindowName.Buffer = DesktopHeapAlloc(Wnd->pdesktop, Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->pdesktop,
UnicodeString.Length + sizeof(UNICODE_NULL)); UnicodeString.Length + sizeof(UNICODE_NULL));
if (Wnd->WindowName.Buffer != NULL) if (Wnd->strName.Buffer != NULL)
{ {
Wnd->WindowName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0'; Wnd->strName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0';
RtlCopyMemory(Wnd->WindowName.Buffer, RtlCopyMemory(Wnd->strName.Buffer,
UnicodeString.Buffer, UnicodeString.Buffer,
UnicodeString.Length); UnicodeString.Length);
Wnd->WindowName.MaximumLength = UnicodeString.Length + sizeof(UNICODE_NULL); Wnd->strName.MaximumLength = UnicodeString.Length + sizeof(UNICODE_NULL);
Wnd->WindowName.Length = UnicodeString.Length; Wnd->strName.Length = UnicodeString.Length;
} }
else else
{ {
@ -4841,9 +4841,9 @@ NtUserDefSetText(HWND hWnd, PLARGE_STRING WindowText)
} }
else else
{ {
Wnd->WindowName.Length = 0; Wnd->strName.Length = 0;
if (Wnd->WindowName.Buffer != NULL) if (Wnd->strName.Buffer != NULL)
Wnd->WindowName.Buffer[0] = L'\0'; Wnd->strName.Buffer[0] = L'\0';
} }
// HAX! FIXME! Windows does not do this in here! // HAX! FIXME! Windows does not do this in here!
@ -4894,7 +4894,7 @@ NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
} }
Wnd = Window->Wnd; Wnd = Window->Wnd;
Result = Wnd->WindowName.Length / sizeof(WCHAR); Result = Wnd->strName.Length / sizeof(WCHAR);
if(lpString) if(lpString)
{ {
const WCHAR Terminator = L'\0'; const WCHAR Terminator = L'\0';
@ -4904,7 +4904,7 @@ NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
Copy = min(nMaxCount - 1, Result); Copy = min(nMaxCount - 1, Result);
if(Copy > 0) if(Copy > 0)
{ {
Status = MmCopyToCaller(Buffer, Wnd->WindowName.Buffer, Copy * sizeof(WCHAR)); Status = MmCopyToCaller(Buffer, Wnd->strName.Buffer, Copy * sizeof(WCHAR));
if(!NT_SUCCESS(Status)) if(!NT_SUCCESS(Status))
{ {
SetLastNtError(Status); SetLastNtError(Status);
@ -4971,7 +4971,7 @@ IntShowOwnedPopups(PWINDOW_OBJECT OwnerWnd, BOOL fShow )
} }
else else
{ {
if (pWnd->Wnd->Style & WS_VISIBLE) if (pWnd->Wnd->style & WS_VISIBLE)
{ {
/* In Windows, ShowOwnedPopups(FALSE) generates /* In Windows, ShowOwnedPopups(FALSE) generates
* WM_SHOWWINDOW messages with SW_PARENTCLOSING, * WM_SHOWWINDOW messages with SW_PARENTCLOSING,

View file

@ -64,8 +64,8 @@ IntGetClientOrigin(PWINDOW_OBJECT Window OPTIONAL, LPPOINT Point)
Point->x = Point->y = 0; Point->x = Point->y = 0;
return FALSE; return FALSE;
} }
Point->x = Window->Wnd->ClientRect.left; Point->x = Window->Wnd->rcClient.left;
Point->y = Window->Wnd->ClientRect.top; Point->y = Window->Wnd->rcClient.top;
return TRUE; return TRUE;
} }
@ -118,7 +118,7 @@ BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL)
if (!Wnd) return FALSE; if (!Wnd) return FALSE;
if (!Wnd->Wnd) return FALSE; if (!Wnd->Wnd) return FALSE;
style = Wnd->Wnd->Style; style = Wnd->Wnd->style;
if (!(style & WS_VISIBLE) && if (!(style & WS_VISIBLE) &&
Wnd->OwnerThread->ThreadsProcess != CsrProcess) return FALSE; Wnd->OwnerThread->ThreadsProcess != CsrProcess) return FALSE;
if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE; if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
@ -150,7 +150,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
} }
/* If this is popup window, try to activate the owner first. */ /* If this is popup window, try to activate the owner first. */
if ((Wnd->Style & WS_POPUP) && (WndTo = IntGetOwner(Window))) if ((Wnd->style & WS_POPUP) && (WndTo = IntGetOwner(Window)))
{ {
WndTo = UserGetAncestor( WndTo, GA_ROOT ); WndTo = UserGetAncestor( WndTo, GA_ROOT );
if (can_activate_window(WndTo)) goto done; if (can_activate_window(WndTo)) goto done;
@ -216,7 +216,7 @@ co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
ChildWnd = WndChild->Wnd; ChildWnd = WndChild->Wnd;
if((ChildWnd->Style & WS_MINIMIZE) != 0 ) if((ChildWnd->style & WS_MINIMIZE) != 0 )
{ {
USER_REFERENCE_ENTRY Ref; USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(WndChild, &Ref); UserRefObjectCo(WndChild, &Ref);
@ -266,12 +266,12 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
if(IntIsDesktopWindow(Parent)) if(IntIsDesktopWindow(Parent))
IntGetDesktopWorkArea(Desktop, &WorkArea); IntGetDesktopWorkArea(Desktop, &WorkArea);
else else
WorkArea = Parent->Wnd->ClientRect; WorkArea = Parent->Wnd->rcClient;
} }
else else
IntGetDesktopWorkArea(Desktop, &WorkArea); IntGetDesktopWorkArea(Desktop, &WorkArea);
Wnd->InternalPos.NormalRect = Window->Wnd->WindowRect; Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow;
IntGetWindowBorderMeasures(Window, &XInc, &YInc); IntGetWindowBorderMeasures(Window, &XInc, &YInc);
Wnd->InternalPos.MaxPos.x = WorkArea.left - XInc; Wnd->InternalPos.MaxPos.x = WorkArea.left - XInc;
Wnd->InternalPos.MaxPos.y = WorkArea.top - YInc; Wnd->InternalPos.MaxPos.y = WorkArea.top - YInc;
@ -280,11 +280,11 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
Wnd->InternalPosInitialized = TRUE; Wnd->InternalPosInitialized = TRUE;
} }
if (Wnd->Style & WS_MINIMIZE) if (Wnd->style & WS_MINIMIZE)
{ {
Wnd->InternalPos.IconPos = *pt; Wnd->InternalPos.IconPos = *pt;
} }
else if (Wnd->Style & WS_MAXIMIZE) else if (Wnd->style & WS_MAXIMIZE)
{ {
Wnd->InternalPos.MaxPos = *pt; Wnd->InternalPos.MaxPos = *pt;
} }
@ -304,14 +304,14 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
Wnd = Window->Wnd; Wnd = Window->Wnd;
Size.x = Wnd->WindowRect.left; Size.x = Wnd->rcWindow.left;
Size.y = Wnd->WindowRect.top; Size.y = Wnd->rcWindow.top;
WinPosInitInternalPos(Window, &Size, &Wnd->WindowRect); WinPosInitInternalPos(Window, &Size, &Wnd->rcWindow);
if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Window->hSelf, ShowFlag)) if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Window->hSelf, ShowFlag))
return SWP_NOSIZE | SWP_NOMOVE; return SWP_NOSIZE | SWP_NOMOVE;
if (Wnd->Style & WS_MINIMIZE) if (Wnd->style & WS_MINIMIZE)
{ {
if (!co_IntSendMessage(Window->hSelf, WM_QUERYOPEN, 0, 0)) if (!co_IntSendMessage(Window->hSelf, WM_QUERYOPEN, 0, 0))
{ {
@ -323,10 +323,10 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
{ {
case SW_MINIMIZE: case SW_MINIMIZE:
{ {
if (Wnd->Style & WS_MAXIMIZE) if (Wnd->style & WS_MAXIMIZE)
{ {
Window->Flags |= WINDOWOBJECT_RESTOREMAX; Window->Flags |= WINDOWOBJECT_RESTOREMAX;
Wnd->Style &= ~WS_MAXIMIZE; Wnd->style &= ~WS_MAXIMIZE;
} }
else else
{ {
@ -334,7 +334,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
} }
co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE | co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
RDW_NOINTERNALPAINT); RDW_NOINTERNALPAINT);
Wnd->Style |= WS_MINIMIZE; Wnd->style |= WS_MINIMIZE;
WinPosFindIconPos(Window, &Wnd->InternalPos.IconPos); WinPosFindIconPos(Window, &Wnd->InternalPos.IconPos);
RECTL_vSetRect(NewPos, Wnd->InternalPos.IconPos.x, Wnd->InternalPos.IconPos.y, RECTL_vSetRect(NewPos, Wnd->InternalPos.IconPos.x, Wnd->InternalPos.IconPos.y,
UserGetSystemMetrics(SM_CXMINIMIZED), UserGetSystemMetrics(SM_CXMINIMIZED),
@ -349,11 +349,11 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
NULL, NULL); NULL, NULL);
DPRINT("Maximize: %d,%d %dx%d\n", DPRINT("Maximize: %d,%d %dx%d\n",
Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y, Size.x, Size.y); Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y, Size.x, Size.y);
if (Wnd->Style & WS_MINIMIZE) if (Wnd->style & WS_MINIMIZE)
{ {
Wnd->Style &= ~WS_MINIMIZE; Wnd->style &= ~WS_MINIMIZE;
} }
Wnd->Style |= WS_MAXIMIZE; Wnd->style |= WS_MAXIMIZE;
RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y, RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y,
Size.x, Size.y); Size.x, Size.y);
break; break;
@ -361,14 +361,14 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
case SW_RESTORE: case SW_RESTORE:
{ {
if (Wnd->Style & WS_MINIMIZE) if (Wnd->style & WS_MINIMIZE)
{ {
Wnd->Style &= ~WS_MINIMIZE; Wnd->style &= ~WS_MINIMIZE;
if (Window->Flags & WINDOWOBJECT_RESTOREMAX) if (Window->Flags & WINDOWOBJECT_RESTOREMAX)
{ {
co_WinPosGetMinMaxInfo(Window, &Size, co_WinPosGetMinMaxInfo(Window, &Size,
&Wnd->InternalPos.MaxPos, NULL, NULL); &Wnd->InternalPos.MaxPos, NULL, NULL);
Wnd->Style |= WS_MAXIMIZE; Wnd->style |= WS_MAXIMIZE;
RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x, RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x,
Wnd->InternalPos.MaxPos.y, Size.x, Size.y); Wnd->InternalPos.MaxPos.y, Size.x, Size.y);
break; break;
@ -383,11 +383,11 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
} }
else else
{ {
if (!(Wnd->Style & WS_MAXIMIZE)) if (!(Wnd->style & WS_MAXIMIZE))
{ {
return 0; return 0;
} }
Wnd->Style &= ~WS_MAXIMIZE; Wnd->style &= ~WS_MAXIMIZE;
*NewPos = Wnd->InternalPos.NormalRect; *NewPos = Wnd->InternalPos.NormalRect;
NewPos->right -= NewPos->left; NewPos->right -= NewPos->left;
NewPos->bottom -= NewPos->top; NewPos->bottom -= NewPos->top;
@ -517,17 +517,17 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
WINDOWPOS winposCopy; WINDOWPOS winposCopy;
params.rgrc[0] = *WindowRect; params.rgrc[0] = *WindowRect;
params.rgrc[1] = Window->Wnd->WindowRect; params.rgrc[1] = Window->Wnd->rcWindow;
params.rgrc[2] = Window->Wnd->ClientRect; params.rgrc[2] = Window->Wnd->rcClient;
Parent = Window->Parent; Parent = Window->Parent;
if (0 != (Wnd->Style & WS_CHILD) && Parent) if (0 != (Wnd->style & WS_CHILD) && Parent)
{ {
RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->Wnd->ClientRect.left, RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->Wnd->rcClient.left,
- Parent->Wnd->ClientRect.top); - Parent->Wnd->rcClient.top);
RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->Wnd->ClientRect.left, RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->Wnd->rcClient.left,
- Parent->Wnd->ClientRect.top); - Parent->Wnd->rcClient.top);
RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->Wnd->ClientRect.left, RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->Wnd->rcClient.left,
- Parent->Wnd->ClientRect.top); - Parent->Wnd->rcClient.top);
} }
params.lppos = &winposCopy; params.lppos = &winposCopy;
winposCopy = *WinPos; winposCopy = *WinPos;
@ -539,26 +539,26 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
params.rgrc[0].top <= params.rgrc[0].bottom) params.rgrc[0].top <= params.rgrc[0].bottom)
{ {
*ClientRect = params.rgrc[0]; *ClientRect = params.rgrc[0];
if ((Wnd->Style & WS_CHILD) && Parent) if ((Wnd->style & WS_CHILD) && Parent)
{ {
RECTL_vOffsetRect(ClientRect, Parent->Wnd->ClientRect.left, RECTL_vOffsetRect(ClientRect, Parent->Wnd->rcClient.left,
Parent->Wnd->ClientRect.top); Parent->Wnd->rcClient.top);
} }
FixClientRect(ClientRect, WindowRect); FixClientRect(ClientRect, WindowRect);
} }
/* FIXME: WVR_ALIGNxxx */ /* FIXME: WVR_ALIGNxxx */
if (ClientRect->left != Wnd->ClientRect.left || if (ClientRect->left != Wnd->rcClient.left ||
ClientRect->top != Wnd->ClientRect.top) ClientRect->top != Wnd->rcClient.top)
{ {
WinPos->flags &= ~SWP_NOCLIENTMOVE; WinPos->flags &= ~SWP_NOCLIENTMOVE;
} }
if ((ClientRect->right - ClientRect->left != if ((ClientRect->right - ClientRect->left !=
Wnd->ClientRect.right - Wnd->ClientRect.left) || Wnd->rcClient.right - Wnd->rcClient.left) ||
(ClientRect->bottom - ClientRect->top != (ClientRect->bottom - ClientRect->top !=
Wnd->ClientRect.bottom - Wnd->ClientRect.top)) Wnd->rcClient.bottom - Wnd->rcClient.top))
{ {
WinPos->flags &= ~SWP_NOCLIENTSIZE; WinPos->flags &= ~SWP_NOCLIENTSIZE;
} }
@ -566,8 +566,8 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
else else
{ {
if (! (WinPos->flags & SWP_NOMOVE) if (! (WinPos->flags & SWP_NOMOVE)
&& (ClientRect->left != Wnd->ClientRect.left || && (ClientRect->left != Wnd->rcClient.left ||
ClientRect->top != Wnd->ClientRect.top)) ClientRect->top != Wnd->rcClient.top))
{ {
WinPos->flags &= ~SWP_NOCLIENTMOVE; WinPos->flags &= ~SWP_NOCLIENTMOVE;
} }
@ -594,8 +594,8 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
co_IntPostOrSendMessage(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos); co_IntPostOrSendMessage(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
} }
*WindowRect = Wnd->WindowRect; *WindowRect = Wnd->rcWindow;
*ClientRect = Wnd->ClientRect; *ClientRect = Wnd->rcClient;
if (!(WinPos->flags & SWP_NOSIZE)) if (!(WinPos->flags & SWP_NOSIZE))
{ {
@ -609,19 +609,19 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
X = WinPos->x; X = WinPos->x;
Y = WinPos->y; Y = WinPos->y;
Parent = Window->Parent; Parent = Window->Parent;
if ((0 != (Wnd->Style & WS_CHILD)) && Parent) if ((0 != (Wnd->style & WS_CHILD)) && Parent)
{ {
X += Parent->Wnd->ClientRect.left; X += Parent->Wnd->rcClient.left;
Y += Parent->Wnd->ClientRect.top; Y += Parent->Wnd->rcClient.top;
} }
WindowRect->left = X; WindowRect->left = X;
WindowRect->top = Y; WindowRect->top = Y;
WindowRect->right += X - Wnd->WindowRect.left; WindowRect->right += X - Wnd->rcWindow.left;
WindowRect->bottom += Y - Wnd->WindowRect.top; WindowRect->bottom += Y - Wnd->rcWindow.top;
RECTL_vOffsetRect(ClientRect, RECTL_vOffsetRect(ClientRect,
X - Wnd->WindowRect.left, X - Wnd->rcWindow.left,
Y - Wnd->WindowRect.top); Y - Wnd->rcWindow.top);
} }
WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE; WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE;
@ -701,7 +701,7 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
if (!(Wnd = UserGetWindowObject(List[i]))) if (!(Wnd = UserGetWindowObject(List[i])))
continue; continue;
if ((Wnd->Wnd->Style & WS_POPUP) && if ((Wnd->Wnd->style & WS_POPUP) &&
UserGetWindow(List[i], GW_OWNER) == hWnd) UserGetWindow(List[i], GW_OWNER) == hWnd)
{ {
USER_REFERENCE_ENTRY Ref; USER_REFERENCE_ENTRY Ref;
@ -735,15 +735,15 @@ WinPosInternalMoveWindow(PWINDOW_OBJECT Window, INT MoveX, INT MoveY)
ASSERT(Window != Window->FirstChild); ASSERT(Window != Window->FirstChild);
Window->Wnd->WindowRect.left += MoveX; Window->Wnd->rcWindow.left += MoveX;
Window->Wnd->WindowRect.right += MoveX; Window->Wnd->rcWindow.right += MoveX;
Window->Wnd->WindowRect.top += MoveY; Window->Wnd->rcWindow.top += MoveY;
Window->Wnd->WindowRect.bottom += MoveY; Window->Wnd->rcWindow.bottom += MoveY;
Window->Wnd->ClientRect.left += MoveX; Window->Wnd->rcClient.left += MoveX;
Window->Wnd->ClientRect.right += MoveX; Window->Wnd->rcClient.right += MoveX;
Window->Wnd->ClientRect.top += MoveY; Window->Wnd->rcClient.top += MoveY;
Window->Wnd->ClientRect.bottom += MoveY; Window->Wnd->rcClient.bottom += MoveY;
for(Child = Window->FirstChild; Child; Child = Child->NextSibling) for(Child = Window->FirstChild; Child; Child = Child->NextSibling)
{ {
@ -764,7 +764,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
if (!Wnd) return FALSE; if (!Wnd) return FALSE;
if (Wnd->Style & WS_VISIBLE) if (Wnd->style & WS_VISIBLE)
{ {
WinPos->flags &= ~SWP_SHOWWINDOW; WinPos->flags &= ~SWP_SHOWWINDOW;
} }
@ -779,15 +779,15 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
WinPos->cy = max(WinPos->cy, 0); WinPos->cy = max(WinPos->cy, 0);
/* Check for right size */ /* Check for right size */
if (Wnd->WindowRect.right - Wnd->WindowRect.left == WinPos->cx && if (Wnd->rcWindow.right - Wnd->rcWindow.left == WinPos->cx &&
Wnd->WindowRect.bottom - Wnd->WindowRect.top == WinPos->cy) Wnd->rcWindow.bottom - Wnd->rcWindow.top == WinPos->cy)
{ {
WinPos->flags |= SWP_NOSIZE; WinPos->flags |= SWP_NOSIZE;
} }
/* Check for right position */ /* Check for right position */
if (Wnd->WindowRect.left == WinPos->x && if (Wnd->rcWindow.left == WinPos->x &&
Wnd->WindowRect.top == WinPos->y) Wnd->rcWindow.top == WinPos->y)
{ {
WinPos->flags |= SWP_NOMOVE; WinPos->flags |= SWP_NOMOVE;
} }
@ -797,7 +797,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
WinPos->flags |= SWP_NOACTIVATE; /* Already active */ WinPos->flags |= SWP_NOACTIVATE; /* Already active */
} }
else else
if ((Wnd->Style & (WS_POPUP | WS_CHILD)) != WS_CHILD) if ((Wnd->style & (WS_POPUP | WS_CHILD)) != WS_CHILD)
{ {
/* Bring to the top when activating */ /* Bring to the top when activating */
if (!(WinPos->flags & SWP_NOACTIVATE)) if (!(WinPos->flags & SWP_NOACTIVATE))
@ -963,7 +963,7 @@ co_WinPosSetWindowPos(
else if(VisRgn) else if(VisRgn)
{ {
REGION_UnlockRgn(VisRgn); REGION_UnlockRgn(VisRgn);
NtGdiOffsetRgn(VisBefore, -Window->Wnd->WindowRect.left, -Window->Wnd->WindowRect.top); NtGdiOffsetRgn(VisBefore, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
} }
} }
} }
@ -1036,8 +1036,8 @@ co_WinPosSetWindowPos(
if (!Window->Wnd) return FALSE; if (!Window->Wnd) return FALSE;
OldWindowRect = Window->Wnd->WindowRect; OldWindowRect = Window->Wnd->rcWindow;
OldClientRect = Window->Wnd->ClientRect; OldClientRect = Window->Wnd->rcClient;
if (OldClientRect.bottom - OldClientRect.top == if (OldClientRect.bottom - OldClientRect.top ==
NewClientRect.bottom - NewClientRect.top) NewClientRect.bottom - NewClientRect.top)
@ -1061,29 +1061,29 @@ co_WinPosSetWindowPos(
NewClientRect.top - OldClientRect.top); NewClientRect.top - OldClientRect.top);
} }
Window->Wnd->WindowRect = NewWindowRect; Window->Wnd->rcWindow = NewWindowRect;
Window->Wnd->ClientRect = NewClientRect; Window->Wnd->rcClient = NewClientRect;
if (!(WinPos.flags & SWP_SHOWWINDOW) && (WinPos.flags & SWP_HIDEWINDOW)) if (!(WinPos.flags & SWP_SHOWWINDOW) && (WinPos.flags & SWP_HIDEWINDOW))
{ {
/* Clear the update region */ /* Clear the update region */
co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOFRAME | co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOFRAME |
RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_ALLCHILDREN); RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_ALLCHILDREN);
if ((Window->Wnd->Style & WS_VISIBLE) && if ((Window->Wnd->style & WS_VISIBLE) &&
Window->Parent == UserGetDesktopWindow()) Window->Parent == UserGetDesktopWindow())
{ {
co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->hSelf); co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->hSelf);
} }
Window->Wnd->Style &= ~WS_VISIBLE; Window->Wnd->style &= ~WS_VISIBLE;
} }
else if (WinPos.flags & SWP_SHOWWINDOW) else if (WinPos.flags & SWP_SHOWWINDOW)
{ {
if (!(Window->Wnd->Style & WS_VISIBLE) && if (!(Window->Wnd->style & WS_VISIBLE) &&
Window->Parent == UserGetDesktopWindow()) Window->Parent == UserGetDesktopWindow())
{ {
co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->hSelf); co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->hSelf);
} }
Window->Wnd->Style |= WS_VISIBLE; Window->Wnd->style |= WS_VISIBLE;
} }
if (Window->UpdateRegion != NULL && Window->UpdateRegion != (HRGN)1) if (Window->UpdateRegion != NULL && Window->UpdateRegion != (HRGN)1)
@ -1111,7 +1111,7 @@ co_WinPosSetWindowPos(
else if(VisRgn) else if(VisRgn)
{ {
REGION_UnlockRgn(VisRgn); REGION_UnlockRgn(VisRgn);
NtGdiOffsetRgn(VisAfter, -Window->Wnd->WindowRect.left, -Window->Wnd->WindowRect.top); NtGdiOffsetRgn(VisAfter, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
} }
/* /*
@ -1226,7 +1226,7 @@ co_WinPosSetWindowPos(
if (RgnType != ERROR && RgnType != NULLREGION) if (RgnType != ERROR && RgnType != NULLREGION)
{ {
/* old code /* old code
NtGdiOffsetRgn(DirtyRgn, Window->WindowRect.left, Window->WindowRect.top); NtGdiOffsetRgn(DirtyRgn, Window->rcWindow.left, Window->rcWindow.top);
IntInvalidateWindows(Window, DirtyRgn, IntInvalidateWindows(Window, DirtyRgn,
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN); RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
} }
@ -1236,11 +1236,11 @@ co_WinPosSetWindowPos(
PWINDOW_OBJECT Parent = Window->Parent; PWINDOW_OBJECT Parent = Window->Parent;
NtGdiOffsetRgn(DirtyRgn, NtGdiOffsetRgn(DirtyRgn,
Window->Wnd->WindowRect.left, Window->Wnd->rcWindow.left,
Window->Wnd->WindowRect.top); Window->Wnd->rcWindow.top);
if ((Window->Wnd->Style & WS_CHILD) && if ((Window->Wnd->style & WS_CHILD) &&
(Parent) && (Parent) &&
!(Parent->Wnd->Style & WS_CLIPCHILDREN)) !(Parent->Wnd->style & WS_CLIPCHILDREN))
{ {
IntInvalidateWindows(Parent, DirtyRgn, IntInvalidateWindows(Parent, DirtyRgn,
RDW_ERASE | RDW_INVALIDATE); RDW_ERASE | RDW_INVALIDATE);
@ -1287,7 +1287,7 @@ co_WinPosSetWindowPos(
if (!(WinPos.flags & SWP_NOACTIVATE)) if (!(WinPos.flags & SWP_NOACTIVATE))
{ {
if ((Window->Wnd->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD) if ((Window->Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{ {
co_IntSendMessage(WinPos.hwnd, WM_CHILDACTIVATE, 0, 0); co_IntSendMessage(WinPos.hwnd, WM_CHILDACTIVATE, 0, 0);
} }
@ -1334,7 +1334,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
if (!Wnd) return FALSE; if (!Wnd) return FALSE;
WasVisible = (Wnd->Style & WS_VISIBLE) != 0; WasVisible = (Wnd->style & WS_VISIBLE) != 0;
switch (Cmd) switch (Cmd)
{ {
@ -1359,7 +1359,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
case SW_MINIMIZE: case SW_MINIMIZE:
{ {
Swp |= SWP_NOACTIVATE; Swp |= SWP_NOACTIVATE;
if (!(Wnd->Style & WS_MINIMIZE)) if (!(Wnd->style & WS_MINIMIZE))
{ {
Swp |= co_WinPosMinMaximize(Window, SW_MINIMIZE, &NewPos) | Swp |= co_WinPosMinMaximize(Window, SW_MINIMIZE, &NewPos) |
SWP_FRAMECHANGED; SWP_FRAMECHANGED;
@ -1378,7 +1378,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
case SW_SHOWMAXIMIZED: case SW_SHOWMAXIMIZED:
{ {
Swp |= SWP_SHOWWINDOW; Swp |= SWP_SHOWWINDOW;
if (!(Wnd->Style & WS_MAXIMIZE)) if (!(Wnd->style & WS_MAXIMIZE))
{ {
Swp |= co_WinPosMinMaximize(Window, SW_MAXIMIZE, &NewPos) | Swp |= co_WinPosMinMaximize(Window, SW_MAXIMIZE, &NewPos) |
SWP_FRAMECHANGED; SWP_FRAMECHANGED;
@ -1411,7 +1411,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
case SW_SHOWDEFAULT: case SW_SHOWDEFAULT:
case SW_RESTORE: case SW_RESTORE:
Swp |= SWP_SHOWWINDOW; Swp |= SWP_SHOWWINDOW;
if (Wnd->Style & (WS_MINIMIZE | WS_MAXIMIZE)) if (Wnd->style & (WS_MINIMIZE | WS_MAXIMIZE))
{ {
Swp |= co_WinPosMinMaximize(Window, SW_RESTORE, &NewPos) | Swp |= co_WinPosMinMaximize(Window, SW_RESTORE, &NewPos) |
SWP_FRAMECHANGED; SWP_FRAMECHANGED;
@ -1435,7 +1435,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
} }
/* We can't activate a child window */ /* We can't activate a child window */
if ((Wnd->Style & WS_CHILD) && if ((Wnd->style & WS_CHILD) &&
!(Wnd->ExStyle & WS_EX_MDICHILD)) !(Wnd->ExStyle & WS_EX_MDICHILD))
{ {
Swp |= SWP_NOACTIVATE | SWP_NOZORDER; Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
@ -1480,30 +1480,30 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
WPARAM wParam = SIZE_RESTORED; WPARAM wParam = SIZE_RESTORED;
Window->Flags &= ~WINDOWOBJECT_NEED_SIZE; Window->Flags &= ~WINDOWOBJECT_NEED_SIZE;
if (Wnd->Style & WS_MAXIMIZE) if (Wnd->style & WS_MAXIMIZE)
{ {
wParam = SIZE_MAXIMIZED; wParam = SIZE_MAXIMIZED;
} }
else if (Wnd->Style & WS_MINIMIZE) else if (Wnd->style & WS_MINIMIZE)
{ {
wParam = SIZE_MINIMIZED; wParam = SIZE_MINIMIZED;
} }
co_IntSendMessage(Window->hSelf, WM_SIZE, wParam, co_IntSendMessage(Window->hSelf, WM_SIZE, wParam,
MAKELONG(Wnd->ClientRect.right - MAKELONG(Wnd->rcClient.right -
Wnd->ClientRect.left, Wnd->rcClient.left,
Wnd->ClientRect.bottom - Wnd->rcClient.bottom -
Wnd->ClientRect.top)); Wnd->rcClient.top));
co_IntSendMessage(Window->hSelf, WM_MOVE, 0, co_IntSendMessage(Window->hSelf, WM_MOVE, 0,
MAKELONG(Wnd->ClientRect.left, MAKELONG(Wnd->rcClient.left,
Wnd->ClientRect.top)); Wnd->rcClient.top));
IntEngWindowChanged(Window, WOC_RGN_CLIENT); IntEngWindowChanged(Window, WOC_RGN_CLIENT);
} }
/* Activate the window if activation is not requested and the window is not minimized */ /* Activate the window if activation is not requested and the window is not minimized */
/* /*
if (!(Swp & (SWP_NOACTIVATE | SWP_HIDEWINDOW)) && !(Window->Style & WS_MINIMIZE)) if (!(Swp & (SWP_NOACTIVATE | SWP_HIDEWINDOW)) && !(Window->style & WS_MINIMIZE))
{ {
WinPosChangeActiveWindow(Wnd, FALSE); WinPosChangeActiveWindow(Wnd, FALSE);
} }
@ -1525,14 +1525,14 @@ PWINDOW_OBJECT child_window_from_point(PWINDOW_OBJECT parent, int x, int y )
if (!IntPtInWindow( Wnd, x, y )) continue; /* skip it */ if (!IntPtInWindow( Wnd, x, y )) continue; /* skip it */
/* if window is minimized or disabled, return at once */ /* if window is minimized or disabled, return at once */
if (Wnd->Style & (WS_MINIMIZE|WS_DISABLED)) return Wnd; if (Wnd->style & (WS_MINIMIZE|WS_DISABLED)) return Wnd;
/* if point is not in client area, return at once */ /* if point is not in client area, return at once */
if (x < Wnd->ClientRect.left || x >= Wnd->ClientRect.right || if (x < Wnd->rcClient.left || x >= Wnd->rcClient.right ||
y < Wnd->ClientRect.top || y >= Wnd->ClientRect.bottom) y < Wnd->rcClient.top || y >= Wnd->rcClient.bottom)
return Wnd; return Wnd;
return child_window_from_point( Wnd, x - Wnd->ClientRect.left, y - Wnd->ClientRect.top ); return child_window_from_point( Wnd, x - Wnd->rcClient.left, y - Wnd->rcClient.top );
} }
return parent; /* not found any child */ return parent; /* not found any child */
} }
@ -1567,12 +1567,12 @@ co_WinPosSearchChildren(
continue; continue;
CurrentWnd = Current->Wnd; CurrentWnd = Current->Wnd;
if (!(CurrentWnd->Style & WS_VISIBLE)) if (!(CurrentWnd->style & WS_VISIBLE))
{ {
continue; continue;
} }
if ((CurrentWnd->Style & (WS_POPUP | WS_CHILD | WS_DISABLED)) == if ((CurrentWnd->style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
(WS_CHILD | WS_DISABLED)) (WS_CHILD | WS_DISABLED))
{ {
continue; continue;
@ -1587,13 +1587,13 @@ co_WinPosSearchChildren(
*Window = Current; *Window = Current;
UserReferenceObject(*Window); UserReferenceObject(*Window);
if (CurrentWnd->Style & WS_MINIMIZE) if (CurrentWnd->style & WS_MINIMIZE)
{ {
*HitTest = HTCAPTION; *HitTest = HTCAPTION;
break; break;
} }
if (CurrentWnd->Style & WS_DISABLED) if (CurrentWnd->style & WS_DISABLED)
{ {
*HitTest = HTERROR; *HitTest = HTERROR;
break; break;
@ -1614,10 +1614,10 @@ co_WinPosSearchChildren(
else else
*HitTest = HTCLIENT; *HitTest = HTCLIENT;
if (Point->x >= CurrentWnd->ClientRect.left && if (Point->x >= CurrentWnd->rcClient.left &&
Point->x < CurrentWnd->ClientRect.right && Point->x < CurrentWnd->rcClient.right &&
Point->y >= CurrentWnd->ClientRect.top && Point->y >= CurrentWnd->rcClient.top &&
Point->y < CurrentWnd->ClientRect.bottom) Point->y < CurrentWnd->rcClient.bottom)
{ {
co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest); co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
} }
@ -1650,7 +1650,7 @@ co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTes
return(HTERROR); return(HTERROR);
} }
if (ScopeWin->Wnd->Style & WS_DISABLED) if (ScopeWin->Wnd->style & WS_DISABLED)
{ {
return(HTERROR); return(HTERROR);
} }
@ -1660,8 +1660,8 @@ co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTes
if((DesktopWindowHandle != ScopeWin->hSelf) && if((DesktopWindowHandle != ScopeWin->hSelf) &&
(DesktopWindow = UserGetWindowObject(DesktopWindowHandle))) (DesktopWindow = UserGetWindowObject(DesktopWindowHandle)))
{ {
Point.x += ScopeWin->Wnd->ClientRect.left - DesktopWindow->Wnd->ClientRect.left; Point.x += ScopeWin->Wnd->rcClient.left - DesktopWindow->Wnd->rcClient.left;
Point.y += ScopeWin->Wnd->ClientRect.top - DesktopWindow->Wnd->ClientRect.top; Point.y += ScopeWin->Wnd->rcClient.top - DesktopWindow->Wnd->rcClient.top;
} }
HitTest = HTNOWHERE; HitTest = HTNOWHERE;
@ -1698,10 +1698,10 @@ NtUserGetMinMaxInfo(
UserRefObjectCo(Window, &Ref); UserRefObjectCo(Window, &Ref);
Wnd = Window->Wnd; Wnd = Window->Wnd;
Size.x = Window->Wnd->WindowRect.left; Size.x = Window->Wnd->rcWindow.left;
Size.y = Window->Wnd->WindowRect.top; Size.y = Window->Wnd->rcWindow.top;
WinPosInitInternalPos(Window, &Size, WinPosInitInternalPos(Window, &Size,
&Wnd->WindowRect); &Wnd->rcWindow);
if(SendMessage) if(SendMessage)
{ {