- Move to the new window structure. Window Object served us well.
svn path=/trunk/; revision=49109
static const BOOL g_ObjectHeapTypeShared[VALIDATE_TYPE_EVENT + 1] =
{
FALSE, /* VALIDATE_TYPE_FREE (not used) */
- TRUE, /* VALIDATE_TYPE_WIN FALSE */
+ FALSE, /* VALIDATE_TYPE_WIN FALSE */
TRUE, /* VALIDATE_TYPE_MENU FALSE */
TRUE, /* VALIDATE_TYPE_CURSOR */
TRUE, /* VALIDATE_TYPE_MWPOS */
return NULL;
}
-// HACK HACK HACK!
-typedef struct _WNDX
-{
- THRDESKHEAD head;
- PWND pWnd;
-} WNDX, *PWNDX;
//
// Validate a window handle and return the pointer to the object.
/* See if the window is cached */
if (hwnd == ClientInfo->CallbackWnd.hWnd)
- return ClientInfo->CallbackWnd.pvWnd;
+ return ClientInfo->CallbackWnd.pWnd;
Wnd = ValidateHandle((HANDLE)hwnd, VALIDATE_TYPE_WIN);
if (Wnd != NULL)
{
-#if 0
return Wnd;
-#else
- /* HACK HACK HACK! This needs to be done until WINDOW_OBJECT is completely
- superseded by the WINDOW structure. We *ASSUME* a pointer to the WINDOW
- structure to be at the beginning of the WINDOW_OBJECT structure!!!
-
- !!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!!
- */
-
- if ( ((PWNDX)Wnd)->pWnd != NULL)
- return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd );
-#endif
}
return NULL;
/* See if the window is cached */
if (hwnd == ClientInfo->CallbackWnd.hWnd)
- return ClientInfo->CallbackWnd.pvWnd;
+ return ClientInfo->CallbackWnd.pWnd;
Wnd = ValidateHandleNoErr((HANDLE)hwnd, VALIDATE_TYPE_WIN);
if (Wnd != NULL)
{
-#if 0
return Wnd;
-#else
- /* HACK HACK HACK! This needs to be done until WINDOW_OBJECT is completely
- superseded by the WINDOW structure. We *ASSUME* a pointer to the WINDOW
- structure to be at the beginning of the WINDOW_OBJECT structure!!!
-
- !!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!!
- */
-
- if ( ((PWNDX)Wnd)->pWnd != NULL)
- return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd );
-#endif
}
return NULL;
IS_ATOM(lpszClass) ? lpszClass : 0,
lpwcx);
- //HACKHACK: This is ROS-specific and should go away
- lpwcx->cbSize = sizeof(*lpwcx);
+ if (!lpwcx)
+ {
+ SetLastError( ERROR_NOACCESS );
+ return FALSE;
+ }
if (hInstance == User32Instance)
{
IS_ATOM(lpszClass) ? lpszClass : 0,
lpwcx);
- //HACKHACK: This is ROS-specific and should go away
- lpwcx->cbSize = sizeof(*lpwcx);
+ /* From wine, for speed only, ReactOS supports the correct return in
+ * Win32k. cbSize is ignored.
+ */
+ if (!lpwcx)
+ {
+ SetLastError( ERROR_NOACCESS );
+ return FALSE;
+ }
if (hInstance == User32Instance)
{
else
{
info->className = (LPCWSTR)p;
- p += wcslen( info->className ) + 1;
+ p += strlenW( info->className ) + 1;
}
if (GET_WORD(p) == 0xffff) /* Is it an integer id? */
{
info->windowName = (LPCWSTR)p;
info->windowNameFree = FALSE;
- p += wcslen( info->windowName ) + 1;
+ p += strlenW( info->windowName ) + 1;
}
if (GET_WORD(p))
if (!IsWindow(hParent)) break;
pWnd = ValidateHwnd(hParent);
- if (!pWnd) break;
+ // FIXME: Use pWnd->fnid == FNID_DESKTOP
+ if (!pWnd || hParent == GetDesktopWindow()) break;
if (!(pWnd->state & WNDS_DIALOGWINDOW))
{
while (p != NULL && p[1] == '&');
/* and check if it's the one we're looking for */
- /* FIXME: usage of towupper correct? */
- if (p != NULL && towupper( p[1] ) == towupper( wParam ) )
+ if (p != NULL && toupperW( p[1] ) == toupperW( wParam ) )
{
if ((dlgCode & DLGC_STATIC) || (style & 0x0f) == BS_GROUPBOX )
{
break;
default:
result->menuName = (LPCWSTR)p;
- p += wcslen( result->menuName ) + 1;
+ p += strlenW( result->menuName ) + 1;
break;
}
break;
default:
result->className = (LPCWSTR)p;
- p += wcslen( result->className ) + 1;
+ p += strlenW( result->className ) + 1;
break;
}
/* Get the window caption */
result->caption = (LPCWSTR)p;
- p += wcslen( result->caption ) + 1;
+ p += strlenW( result->caption ) + 1;
/* Get the font name */
result->italic = LOBYTE(GET_WORD(p)); p++;
}
result->faceName = (LPCWSTR)p;
- p += wcslen( result->faceName ) + 1;
+ p += strlenW( result->faceName ) + 1;
}
}
dlgInfo->yBaseUnit = yBaseUnit;
dlgInfo->idResult = IDOK;
dlgInfo->flags = flags;
- /* dlgInfo->hDialogHeap = 0; */
if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId );
//// ReactOS
if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_ROS_DIALOGINFO, 0 )))
{
- /* Free dialog heap (if created) */
- /*if (dlgInfo->hDialogHeap)
- {
- GlobalUnlock16(dlgInfo->hDialogHeap);
- GlobalFree16(dlgInfo->hDialogHeap);
- }*/
if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont );
if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
HeapFree( GetProcessHeap(), 0, dlgInfo );
HWND hDlg,
LPMSG lpMsg)
{
- INT dlgCode = 0;
-
- // FIXME: hooks
- if (CallMsgFilterW( lpMsg, MSGF_DIALOGBOX )) return TRUE;
+ INT dlgCode = 0;
- if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
+ if (CallMsgFilterW( lpMsg, MSGF_DIALOGBOX )) return TRUE;
if (hDlg == GetDesktopWindow()) return FALSE;
+ if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
hDlg = DIALOG_FindMsgDestination(hDlg);
{
INT length;
SendMessageW (hwndNext, WM_GETTEXT, maxlen, (LPARAM) buffer);
- length = wcslen (buffer);
+ length = strlenW (buffer);
HeapFree (GetProcessHeap(), 0, buffer);
SendMessageW (hwndNext, EM_SETSEL, 0, length);
}
else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0)))
{
HWND hwndDef = GetDlgItem(hDlg, LOWORD(dw));
- if (!hwndDef || !IsWindowEnabled(hwndDef))
- return TRUE;
-
- SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
- (LPARAM)GetDlgItem(hDlg, LOWORD(dw)));
+ if (hwndDef ? IsWindowEnabled(hwndDef) : LOWORD(dw)==IDOK)
+ SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)hwndDef);
}
else
{
break;
case WM_CHAR:
+ /* FIXME Under what circumstances does WM_GETDLGCODE get sent?
+ * It does NOT get sent in the test program I have
+ */
dlgCode = SendMessageW( lpMsg->hwnd, WM_GETDLGCODE, lpMsg->wParam, (LPARAM)lpMsg );
if (dlgCode & (DLGC_WANTCHARS|DLGC_WANTMESSAGE)) break;
if (lpMsg->wParam == '\t' && (dlgCode & DLGC_WANTTAB)) break;
return TRUE;
}
break;
-
+//// ReactOS
case WM_SYSKEYDOWN:
/* If the ALT key is being pressed display the keyboard cues */
if (lpMsg->lParam & (1 << 29))
}
if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
- pWnd = pci->CallbackWnd.pvWnd;
+ pWnd = pci->CallbackWnd.pWnd;
CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
CallbackArgs->Proc,
typedef struct _CALLBACKWND
{
HWND hWnd;
- PVOID pvWnd;
+ struct _WND *pWnd;
} CALLBACKWND, *PCALLBACKWND;
#define CI_TRANSACTION 0x00000001
} CLS, *PCLS;
+typedef struct _SBINFOEX
+{
+ SCROLLBARINFO ScrollBarInfo;
+ SCROLLINFO ScrollInfo;
+} SBINFOEX, *PSBINFOEX;
+
// State Flags !Not Implemented!
#define WNDS_HASMENU 0X00000001
#define WNDS_HASVERTICALSCROOLLBAR 0X00000002
struct _WND *spwndClipboardListener;
DWORD ExStyle2;
+ /* ReactOS */
struct
{
RECT NormalRect;
UINT InternalPosInitialized : 1;
UINT HideFocus : 1; // WS_EX_UISTATEFOCUSRECTHIDDEN ?
UINT HideAccel : 1; // WS_EX_UISTATEKBACCELHIDDEN ?
+
+ /* Scrollbar info */
+ PSBINFOEX pSBInfoex; // convert to PSBINFO
+ /* Entry in the list of thread windows. */
+ LIST_ENTRY ThreadListEntry;
} WND, *PWND;
typedef struct _PFNCLIENT
HWND hWnd,
HMENU hMenu);
-DWORD
+BOOL
NTAPI
NtUserThunkedMenuInfo(
HMENU hMenu,
LPCMENUINFO lpcmi);
-DWORD
+BOOL
NTAPI
NtUserThunkedMenuItemInfo(
HMENU hMenu,
BOOL fsog
);
-
-
typedef struct tagROSMENUITEMINFO
{
/* ----------- MENUITEMINFOW ----------- */
}
/*
- * Fills the CLIPOBJ and client rect of the WNDOBJ with the data from the given WINDOW_OBJECT
+ * Fills the CLIPOBJ and client rect of the WNDOBJ with the data from the given WND
*/
BOOLEAN
FASTCALL
IntEngWndUpdateClipObj(
WNDGDI *WndObjInt,
- PWINDOW_OBJECT Window)
+ PWND Window)
{
HRGN hVisRgn;
PROSRGNDATA visRgn;
hVisRgn = VIS_ComputeVisibleRegion(Window, TRUE, TRUE, TRUE);
if (hVisRgn != NULL)
{
- NtGdiOffsetRgn(hVisRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
+ NtGdiOffsetRgn(hVisRgn, Window->rcClient.left, Window->rcClient.top);
visRgn = RGNOBJAPI_Lock(hVisRgn, NULL);
if (visRgn != NULL)
{
if (ClipObj == NULL)
{
/* Fall back to client rect */
- ClipObj = IntEngCreateClipRegion(1, &Window->Wnd->rcClient,
- &Window->Wnd->rcClient);
+ ClipObj = IntEngCreateClipRegion(1, &Window->rcClient,
+ &Window->rcClient);
}
if (ClipObj == NULL)
}
RtlCopyMemory(&WndObjInt->WndObj.coClient, ClipObj, sizeof (CLIPOBJ));
- RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->rcClient, sizeof (RECT));
+ RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->rcClient, sizeof (RECT));
OldClipObj = InterlockedExchangePointer((PVOID*)&WndObjInt->ClientClipObj, ClipObj);
if (OldClipObj != NULL)
IntEngDeleteClipRegion(OldClipObj);
}
/*
- * Updates all WNDOBJs of the given WINDOW_OBJECT and calls the change-procs.
+ * Updates all WNDOBJs of the given WND and calls the change-procs.
*/
VOID
FASTCALL
IntEngWindowChanged(
- PWINDOW_OBJECT Window,
+ PWND Window,
FLONG flChanged)
{
WNDGDI *Current;
ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL);
- hWnd = Window->hSelf; // pWnd->head.h;
+ hWnd = Window->head.h;
Current = (WNDGDI *)IntGetProp(Window, AtomWndObj);
if ( gcountPWO &&
{
WNDGDI *WndObjInt = NULL;
WNDOBJ *WndObjUser = NULL;
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL calledFromUser;
DECLARE_RETURN(WNDOBJ*);
IN WNDOBJ *pwo)
{
WNDGDI *WndObjInt = ObjToGDI(pwo, WND);
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL calledFromUser;
DPRINT("EngDeleteWnd: pwo = 0x%x\n", pwo);
BOOL FASTCALL
IntSwitchCaretShowing(PVOID Info);
-BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT WindowObject);
+BOOL FASTCALL co_UserShowCaret(PWND WindowObject);
-BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT WindowObject);
+BOOL FASTCALL co_UserHideCaret(PWND WindowObject);
/* EOF */
typedef struct _ClipboardChainElement
{
- PWINDOW_OBJECT window;
+ PWND window;
struct _ClipboardChainElement *next;
} CLIPBOARDCHAINELEMENT, *PCLIPBOARDCHAINELEMENT;
{
PTHREADINFO ClipboardThread;
PTHREADINFO ClipboardOwnerThread;
- PWINDOW_OBJECT ClipboardWindow;
- PWINDOW_OBJECT ClipboardViewerWindow;
- PWINDOW_OBJECT ClipboardOwnerWindow;
+ PWND ClipboardWindow;
+ PWND ClipboardViewerWindow;
+ PWND ClipboardOwnerWindow;
BOOL sendDrawClipboardMsg;
BOOL recentlySetClipboard;
BOOL delayedRender;
} CLIPBOARDSYSTEM, *PCLIPBOARDSYSTEM;
VOID FASTCALL
-IntClipboardFreeWindow(PWINDOW_OBJECT window);
+IntClipboardFreeWindow(PWND window);
UINT APIENTRY IntEnumClipboardFormats(UINT format);
#define DCX_INDESTROY 0x00400000
BOOL FASTCALL DCE_Cleanup(PDCE pDce);
-PDCE FASTCALL DceAllocDCE(PWINDOW_OBJECT Window, DCE_TYPE Type);
+PDCE FASTCALL DceAllocDCE(PWND Window, DCE_TYPE Type);
PDCE FASTCALL DCE_FreeDCE(PDCE dce);
VOID FASTCALL DCE_FreeWindowDCE(HWND);
INT FASTCALL DCE_ExcludeRgn(HDC, HWND, HRGN);
HWND FASTCALL IntWindowFromDC(HDC hDc);
PDCE FASTCALL DceFreeDCE(PDCE dce, BOOLEAN Force);
void FASTCALL DceEmptyCache(void);
-VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window);
+VOID FASTCALL DceResetActiveDCEs(PWND Window);
void FASTCALL DceFreeClassDCE(HDC);
HWND FASTCALL UserGethWnd(HDC,PWNDOBJ*);
-void FASTCALL DceFreeWindowDCE(PWINDOW_OBJECT);
+void FASTCALL DceFreeWindowDCE(PWND);
void FASTCALL DceFreeThreadDCE(PTHREADINFO);
HWND FASTCALL
IntGetDesktopWindow (VOID);
-PWINDOW_OBJECT FASTCALL
+PWND FASTCALL
UserGetDesktopWindow(VOID);
HWND FASTCALL
VOID FASTCALL
IntEngWindowChanged(
- PWINDOW_OBJECT Window,
+ PWND Window,
FLONG flChanged);
VOID FASTCALL IntGdiAcquireSemaphore ( HSEMAPHORE hsem );
HWND FASTCALL UserGetActiveWindow(VOID);
BOOL FASTCALL
-co_IntMouseActivateWindow(PWINDOW_OBJECT Window);
+co_IntMouseActivateWindow(PWND Window);
BOOL FASTCALL
-co_IntSetForegroundWindow(PWINDOW_OBJECT Window);
+co_IntSetForegroundWindow(PWND Window);
HWND FASTCALL
-co_IntSetActiveWindow(PWINDOW_OBJECT Window);
+co_IntSetActiveWindow(PWND Window);
int *id);
VOID FASTCALL
-UnregisterWindowHotKeys(PWINDOW_OBJECT Window);
+UnregisterWindowHotKeys(PWND Window);
VOID FASTCALL
UnregisterThreadHotKeys(struct _ETHREAD *Thread);
BOOL FASTCALL
IntSetMenuItemRect(PMENU_OBJECT MenuObject, UINT Item, BOOL fByPos, RECTL *rcRect);
-DWORD APIENTRY UserInsertMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW lpmii);
+DWORD FASTCALL UserInsertMenuItem(PMENU_OBJECT Menu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW lpmii);
BOOL FASTCALL
IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process);
co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
- IN PWINDOW_OBJECT Window,
+ IN PWND Window,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message);
BOOLEAN FASTCALL
co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
NTSTATUS FASTCALL
-co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
+co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
UINT MsgFilterMin, UINT MsgFilterMax);
VOID FASTCALL
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
#include <include/window.h>
BOOL FASTCALL
-co_UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECTL* UpdateRect, HRGN UpdateRgn, ULONG Flags);
+co_UserRedrawWindow(PWND Wnd, const RECTL* UpdateRect, HRGN UpdateRgn, ULONG Flags);
VOID FASTCALL
-IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags);
+IntInvalidateWindows(PWND Window, HRGN hRgn, ULONG Flags);
BOOL FASTCALL
-IntGetPaintMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread,
+IntGetPaintMessage(PWND Window, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread,
MSG *Message, BOOL Remove);
INT FASTCALL UserRealizePalette(HDC);
-INT FASTCALL co_UserGetUpdateRgn(PWINDOW_OBJECT, HRGN, BOOL);
+INT FASTCALL co_UserGetUpdateRgn(PWND, HRGN, BOOL);
#pragma once
-PPROPERTY FASTCALL IntGetProp(PWINDOW_OBJECT,ATOM);
-BOOL FASTCALL IntRemoveProp(PWINDOW_OBJECT,ATOM);
-BOOL FASTCALL IntSetProp(PWINDOW_OBJECT, ATOM, HANDLE);
+PPROPERTY FASTCALL IntGetProp(PWND,ATOM);
+BOOL FASTCALL IntRemoveProp(PWND,ATOM);
+BOOL FASTCALL IntSetProp(PWND, ATOM, HANDLE);
PSBCALC pSBCalc;
} SBTRACK, *PSBTRACK;
-
+/*
typedef struct _SBINFOEX
{
SCROLLBARINFO ScrollBarInfo;
SCROLLINFO ScrollInfo;
} SBINFOEX, *PSBINFOEX;
-
+*/
#define IntGetScrollbarInfoFromWindow(Window, i) \
- ((PSCROLLBARINFO)(&((Window)->pSBInfo + i)->ScrollBarInfo))
+ ((PSCROLLBARINFO)(&((Window)->pSBInfoex + i)->ScrollBarInfo))
#define IntGetScrollInfoFromWindow(Window, i) \
- ((LPSCROLLINFO)(&((Window)->pSBInfo + i)->ScrollInfo))
+ ((LPSCROLLINFO)(&((Window)->pSBInfoex + i)->ScrollInfo))
#define SBOBJ_TO_SBID(Obj) ((Obj) - OBJID_HSCROLL)
#define SBID_IS_VALID(id) (id == SB_HORZ || id == SB_VERT || id == SB_CTL)
-BOOL FASTCALL co_IntCreateScrollBars(PWINDOW_OBJECT Window);
-BOOL FASTCALL IntDestroyScrollBars(PWINDOW_OBJECT Window);
+BOOL FASTCALL co_IntCreateScrollBars(PWND Window);
+BOOL FASTCALL IntDestroyScrollBars(PWND Window);
HEAD head;
LIST_ENTRY ptmrList;
PTHREADINFO pti;
- PWINDOW_OBJECT pWnd; // hWnd
+ PWND pWnd; // hWnd
UINT_PTR nID; // Specifies a nonzero timer identifier.
INT cmsCountdown; // uElapse
INT cmsRate; // uElapse
NTSTATUS FASTCALL InitTimerImpl(VOID);
BOOL FASTCALL DestroyTimersForThread(PTHREADINFO pti);
-BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window);
-BOOL FASTCALL IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer);
-UINT_PTR FASTCALL IntSetTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
+BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWND Window);
+BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer);
+UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
PTIMER FASTCALL FindSystemTimer(PMSG);
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,LPARAM);
VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD);
-UINT_PTR FASTCALL SystemTimerSet(PWINDOW_OBJECT,UINT_PTR,UINT,TIMERPROC);
-BOOL FASTCALL PostTimerMessages(PWINDOW_OBJECT);
+UINT_PTR FASTCALL SystemTimerSet(PWND,UINT_PTR,UINT,TIMERPROC);
+BOOL FASTCALL PostTimerMessages(PWND);
VOID FASTCALL ProcessTimers(VOID);
VOID FASTCALL StartTheTimers(VOID);
#define DUMP_REFS(obj) DPRINT1("obj 0x%x, refs %i\n",obj, ((PHEAD)obj)->cLockObj)
-PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd);
+PWND FASTCALL IntGetWindowObject(HWND hWnd);
/*************** WINSTA.C ***************/
/*************** WINPOS.C ***************/
BOOL FASTCALL
-UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point);
+UserGetClientOrigin(PWND Window, LPPOINT Point);
/*************** FOCUS.C ***************/
HWND FASTCALL UserGetForegroundWindow(VOID);
-HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window);
+HWND FASTCALL co_UserSetFocus(PWND Window);
/*************** WINDC.C ***************/
INT FASTCALL
-UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint);
+UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint);
HDC FASTCALL
-UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
+UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
HDC FASTCALL
-UserGetWindowDC(PWINDOW_OBJECT Wnd);
+UserGetWindowDC(PWND Wnd);
/*************** SESSION.C ***************/
/*************** PAINTING.C ***************/
-BOOL FASTCALL co_UserValidateRgn(PWINDOW_OBJECT Window, HRGN hRgn);
+BOOL FASTCALL co_UserValidateRgn(PWND Window, HRGN hRgn);
/*************** WINDOW.C ***************/
-PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd);
+PWND FASTCALL UserGetWindowObject(HWND hWnd);
VOID FASTCALL
co_DestroyThreadWindows(struct _ETHREAD *Thread);
HWND FASTCALL UserGetShellWindow(VOID);
HDC FASTCALL
-UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
+UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
-BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Wnd);
+BOOLEAN FASTCALL co_UserDestroyWindow(PWND Wnd);
-PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
+PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type);
/*************** MENU.C ***************/
/*************** SCROLLBAR.C ***************/
DWORD FASTCALL
-co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow);
+co_UserShowScrollBar(PWND Window, int wBar, DWORD bShow);
/* EOF */
#include <include/window.h>
HRGN FASTCALL
-VIS_ComputeVisibleRegion(PWINDOW_OBJECT Window, BOOLEAN ClientArea,
+VIS_ComputeVisibleRegion(PWND Window, BOOLEAN ClientArea,
BOOLEAN ClipChildren, BOOLEAN ClipSiblings);
VOID FASTCALL
-co_VIS_WindowLayoutChanged(PWINDOW_OBJECT Window, HRGN UncoveredRgn);
+co_VIS_WindowLayoutChanged(PWND Window, HRGN UncoveredRgn);
/* EOF */
BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam);
-typedef struct _WINDOW_OBJECT
-{
- THRDESKHEAD head;
- PWND Wnd;
-
- /* Pointer to the thread information */
- PTHREADINFO pti; // Use Wnd->head.pti
- /* system menu handle. */
- HMENU SystemMenu;
- /* Handle for the window. */
- HWND hSelf; // Use Wnd->head.h
- /* Window flags. */
- ULONG state;
- /* Handle of region of the window to be updated. */
- HANDLE hrgnUpdate;
- /* Handle of the window region. */
- HANDLE hrgnClip;
- struct _WINDOW_OBJECT* spwndChild;
- struct _WINDOW_OBJECT* spwndNext;
- struct _WINDOW_OBJECT* spwndPrev;
- struct _WINDOW_OBJECT* spwndParent;
- struct _WINDOW_OBJECT* spwndOwner;
-
- /* Scrollbar info */
- PSBINFOEX pSBInfo; // convert to PSBINFO
- /* Entry in the list of thread windows. */
- LIST_ENTRY ThreadListEntry;
-} WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
-
-/* Window flags. */
-#define WINDOWOBJECT_NEED_SIZE WNDS_SENDSIZEMOVEMSGS
-#define WINDOWOBJECT_NEED_ERASEBKGND WNDS_ERASEBACKGROUND
-#define WINDOWOBJECT_NEED_NCPAINT WNDS_SENDNCPAINT
-#define WINDOWOBJECT_RESTOREMAX (0x00000020) // Set/Clr WS_MAXIMIZE && Clr/Set WS_EX2_VERTICALLYMAXIMIZEDLEFT/RIGHT
-
-#define WINDOWSTATUS_DESTROYING WNDS2_INDESTROY
-#define WINDOWSTATUS_DESTROYED WNDS_DESTROYED
-
#define HAS_DLGFRAME(Style, ExStyle) \
(((ExStyle) & WS_EX_DLGMODALFRAME) || \
(((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
#define IntWndBelongsToThread(WndObj, W32Thread) \
- (((WndObj->pti->pEThread && WndObj->pti->pEThread->Tcb.Win32Thread)) && \
- (WndObj->pti->pEThread->Tcb.Win32Thread == W32Thread))
-// ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
+ ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
#define IntGetWndThreadId(WndObj) \
- WndObj->pti->pEThread->Cid.UniqueThread
-// WndObj->head.pti->pEThread->Cid.UniqueThread
+ WndObj->head.pti->pEThread->Cid.UniqueThread
#define IntGetWndProcessId(WndObj) \
- WndObj->pti->pEThread->ThreadsProcess->UniqueProcessId
-// WndObj->head.pti->pEThread->ThreadsProcess->UniqueProcessId
+ WndObj->head.pti->pEThread->ThreadsProcess->UniqueProcessId
BOOL FASTCALL
IntIsWindow(HWND hWnd);
HWND* FASTCALL
-IntWinListChildren(PWINDOW_OBJECT Window);
+IntWinListChildren(PWND Window);
NTSTATUS FASTCALL
InitWindowImpl (VOID);
CleanupWindowImpl (VOID);
VOID FASTCALL
-IntGetClientRect (PWINDOW_OBJECT WindowObject, RECTL *Rect);
+IntGetClientRect (PWND WindowObject, RECTL *Rect);
HWND FASTCALL
IntGetActiveWindow (VOID);
BOOL FASTCALL
-IntIsWindowVisible (PWINDOW_OBJECT Window);
+IntIsWindowVisible (PWND Window);
BOOL FASTCALL
-IntIsChildWindow (PWINDOW_OBJECT Parent, PWINDOW_OBJECT Child);
+IntIsChildWindow (PWND Parent, PWND Child);
VOID FASTCALL
-IntUnlinkWindow(PWINDOW_OBJECT Wnd);
+IntUnlinkWindow(PWND Wnd);
VOID FASTCALL
-IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndPrevSibling);
+IntLinkWindow(PWND Wnd, PWND WndPrevSibling);
VOID FASTCALL
-IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev);
+IntLinkHwnd(PWND Wnd, HWND hWndPrev);
-PWINDOW_OBJECT FASTCALL
-IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
+PWND FASTCALL
+IntGetAncestor(PWND Wnd, UINT Type);
-PWINDOW_OBJECT FASTCALL
-IntGetParent(PWINDOW_OBJECT Wnd);
+PWND FASTCALL
+IntGetParent(PWND Wnd);
INT FASTCALL
-IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn);
+IntGetWindowRgn(PWND Window, HRGN hRgn);
INT FASTCALL
-IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect);
+IntGetWindowRgnBox(PWND Window, RECTL *Rect);
BOOL FASTCALL
-IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);
+IntGetWindowInfo(PWND WindowObject, PWINDOWINFO pwi);
VOID FASTCALL
-IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy);
+IntGetWindowBorderMeasures(PWND WindowObject, UINT *cx, UINT *cy);
BOOL FASTCALL
-IntIsWindowInDestroy(PWINDOW_OBJECT Window);
+IntIsWindowInDestroy(PWND Window);
BOOL FASTCALL
-IntShowOwnedPopups( PWINDOW_OBJECT owner, BOOL fShow );
+IntShowOwnedPopups( PWND owner, BOOL fShow );
LRESULT FASTCALL
-IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
+IntDefWindowProc( PWND Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG);
#pragma once
#define IntPtInWindow(WndObject,x,y) \
- ((x) >= (WndObject)->Wnd->rcWindow.left && \
- (x) < (WndObject)->Wnd->rcWindow.right && \
- (y) >= (WndObject)->Wnd->rcWindow.top && \
- (y) < (WndObject)->Wnd->rcWindow.bottom && \
- (!(WndObject)->hrgnClip || ((WndObject)->Wnd->style & WS_MINIMIZE) || \
- NtGdiPtInRegion((WndObject)->hrgnClip, (INT)((x) - (WndObject)->Wnd->rcWindow.left), \
- (INT)((y) - (WndObject)->Wnd->rcWindow.top))))
+ ((x) >= (WndObject)->rcWindow.left && \
+ (x) < (WndObject)->rcWindow.right && \
+ (y) >= (WndObject)->rcWindow.top && \
+ (y) < (WndObject)->rcWindow.bottom && \
+ (!(WndObject)->hrgnClip || ((WndObject)->style & WS_MINIMIZE) || \
+ NtGdiPtInRegion((WndObject)->hrgnClip, (INT)((x) - (WndObject)->rcWindow.left), \
+ (INT)((y) - (WndObject)->rcWindow.top))))
UINT
-FASTCALL co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent);
+FASTCALL co_WinPosArrangeIconicWindows(PWND parent);
BOOL FASTCALL
-IntGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point);
+IntGetClientOrigin(PWND Window, LPPOINT Point);
LRESULT FASTCALL
-co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECTL* WindowRect, RECTL* ClientRect);
+co_WinPosGetNonClientSize(PWND Window, RECTL* WindowRect, RECTL* ClientRect);
UINT FASTCALL
-co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
+co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos,
POINT* MinTrack, POINT* MaxTrack);
UINT FASTCALL
-co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECTL* NewPos);
+co_WinPosMinMaximize(PWND WindowObject, UINT ShowFlag, RECTL* NewPos);
BOOLEAN FASTCALL
-co_WinPosSetWindowPos(PWINDOW_OBJECT Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
+co_WinPosSetWindowPos(PWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
INT cy, UINT flags);
BOOLEAN FASTCALL
-co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd);
+co_WinPosShowWindow(PWND Window, INT Cmd);
void FASTCALL
-co_WinPosSendSizeMove(PWINDOW_OBJECT Window);
+co_WinPosSendSizeMove(PWND Window);
USHORT FASTCALL
-co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
- PWINDOW_OBJECT* Window);
-VOID FASTCALL co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window);
+co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
+ PWND* Window);
+VOID FASTCALL co_WinPosActivateOtherWindow(PWND Window);
-VOID FASTCALL WinPosInitInternalPos(PWINDOW_OBJECT WindowObject,
+VOID FASTCALL WinPosInitInternalPos(PWND WindowObject,
POINT *pt, RECTL *RestoreRect);
static
BOOLEAN FASTCALL
co_IntTranslateAccelerator(
- PWINDOW_OBJECT Window,
+ PWND Window,
UINT message,
WPARAM wParam,
LPARAM lParam,
ASSERT_REFS_CO(Window);
DPRINT("IntTranslateAccelerator(hwnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x)\n",
- Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
+ Window->head.h, message, wParam, lParam, fVirt, key, cmd);
if (wParam != key)
{
}
DPRINT("IntTranslateAccelerator(hwnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x) = FALSE\n",
- Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
+ Window->head.h, message, wParam, lParam, fVirt, key, cmd);
return FALSE;
if (mesg == WM_COMMAND)
{
DPRINT(", sending WM_COMMAND, wParam=%0x\n", 0x10000 | cmd);
- co_IntSendMessage(Window->hSelf, mesg, 0x10000 | cmd, 0L);
+ co_IntSendMessage(Window->head.h, mesg, 0x10000 | cmd, 0L);
}
else if (mesg == WM_SYSCOMMAND)
{
DPRINT(", sending WM_SYSCOMMAND, wParam=%0x\n", cmd);
- co_IntSendMessage(Window->hSelf, mesg, cmd, 0x00010000L);
+ co_IntSendMessage(Window->head.h, mesg, cmd, 0x00010000L);
}
else
{
}
DPRINT("IntTranslateAccelerator(hWnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x) = TRUE\n",
- Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
+ Window->head.h, message, wParam, lParam, fVirt, key, cmd);
return TRUE;
}
HACCEL hAccel,
LPMSG Message)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PACCELERATOR_TABLE Accel = NULL;
ULONG i;
USER_REFERENCE_ENTRY AccelRef, WindowRef;
// This will help user space programs speed up read access with the window object.
//
static VOID
-IntSetTebWndCallback (HWND * hWnd, PVOID * pWnd)
+IntSetTebWndCallback (HWND * hWnd, PWND * pWnd)
{
HWND hWndS = *hWnd;
- PWINDOW_OBJECT Window = UserGetWindowObject(*hWnd);
+ PWND Window = UserGetWindowObject(*hWnd);
PCLIENTINFO ClientInfo = GetWin32ClientInfo();
*hWnd = ClientInfo->CallbackWnd.hWnd;
- *pWnd = ClientInfo->CallbackWnd.pvWnd;
+ *pWnd = ClientInfo->CallbackWnd.pWnd;
ClientInfo->CallbackWnd.hWnd = hWndS;
- ClientInfo->CallbackWnd.pvWnd = DesktopHeapAddressToUser(Window->Wnd);
+ ClientInfo->CallbackWnd.pWnd = DesktopHeapAddressToUser(Window);
}
static VOID
-IntRestoreTebWndCallback (HWND hWnd, PVOID pWnd)
+IntRestoreTebWndCallback (HWND hWnd, PWND pWnd)
{
PCLIENTINFO ClientInfo = GetWin32ClientInfo();
ClientInfo->CallbackWnd.hWnd = hWnd;
- ClientInfo->CallbackWnd.pvWnd = pWnd;
+ ClientInfo->CallbackWnd.pWnd = pWnd;
}
/* FUNCTIONS *****************************************************************/
LRESULT Result)
{
SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments;
- PVOID ResultPointer, pWnd;
+ PVOID ResultPointer;
+ PWND pWnd;
ULONG ResultLength;
NTSTATUS Status;
WINDOWPROC_CALLBACK_ARGUMENTS StackArguments;
PWINDOWPROC_CALLBACK_ARGUMENTS Arguments;
NTSTATUS Status;
- PVOID ResultPointer, pWnd;
+ PVOID ResultPointer;
+ PWND pWnd;
ULONG ResultLength;
ULONG ArgumentLength;
LRESULT Result;
GETCPD Flags,
ULONG_PTR ProcIn)
{
- PWINDOW_OBJECT Window;
PWND Wnd;
ULONG_PTR Result = 0;
UserEnterExclusive();
- if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if (!(Wnd = UserGetWindowObject(hWnd)))
{
goto Cleanup;
}
- Wnd = Window->Wnd;
// Processing Window only from User space.
if ((Flags & ~(UserGetCPDU2A|UserGetCPDA2U)) != UserGetCPDClass)
-BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT Window OPTIONAL)
+BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
if (Window) ASSERT_REFS_CO(Window);
- if(Window && Window->pti->pEThread != PsGetCurrentThread())
+ if(Window && Window->head.pti->pEThread != PsGetCurrentThread())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
- if(Window && ThreadQueue->CaretInfo->hWnd != Window->hSelf)
+ if(Window && ThreadQueue->CaretInfo->hWnd != Window->head.h)
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
}
-BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window OPTIONAL)
+BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
if (Window) ASSERT_REFS_CO(Window);
- if(Window && Window->pti->pEThread != PsGetCurrentThread())
+ if(Window && Window->head.pti->pEThread != PsGetCurrentThread())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
- if(Window && ThreadQueue->CaretInfo->hWnd != Window->hSelf)
+ if(Window && ThreadQueue->CaretInfo->hWnd != Window->head.h)
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
int nWidth,
int nHeight)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
DECLARE_RETURN(BOOL);
RETURN(FALSE);
}
- if(Window->pti->pEThread != PsGetCurrentThread())
+ if(Window->head.pti->pEThread != PsGetCurrentThread())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
RETURN(FALSE);
APIENTRY
NtUserShowCaret(HWND hWnd OPTIONAL)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOL);
BOOL ret;
APIENTRY
NtUserHideCaret(HWND hWnd OPTIONAL)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOL);
BOOL ret;
BOOL Ansi)
{
PPROCESSINFO pi;
- PWINDOW_OBJECT Window;
+ PWND Window;
ULONG_PTR Ret = 0;
UserEnterExclusive();
Window = UserGetWindowObject(hWnd);
if (Window != NULL)
{
- if (Window->pti->ppi != pi)
+ if (Window->head.pti->ppi != pi)
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
goto Cleanup;
dwNewLong = (ULONG_PTR)&Value;
}
- Ret = UserSetClassLongPtr(Window->Wnd->pcls,
+ Ret = UserSetClassLongPtr(Window->pcls,
Offset,
dwNewLong,
Ansi);
if (CapturedClassName.Length & 1)
{
- goto InvalidParameter;
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ Ret = FALSE;
+ _SEH2_LEAVE;
}
if (CapturedClassName.Length != 0)
if (!IS_ATOM(CapturedClassName.Buffer))
{
ERR("NtUserGetClassInfo() got ClassName instead of Atom!\n");
- goto InvalidParameter;
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ Ret = FALSE;
+ _SEH2_LEAVE;
}
SafeClassName.Buffer = CapturedClassName.Buffer;
SafeClassName.MaximumLength = 0;
}
- if (ProbeForReadUint(&lpWndClassEx->cbSize) != sizeof(WNDCLASSEXW))
- {
-InvalidParameter:
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- Ret = FALSE;
- _SEH2_LEAVE;
- }
-
ProbeForWrite( lpWndClassEx, sizeof(WNDCLASSEXW), sizeof(ULONG));
RtlCopyMemory( &Safewcexw, lpWndClassEx, sizeof(WNDCLASSEXW));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST);
+ SetLastNtError(_SEH2_GetExceptionCode());
Ret = FALSE;
}
_SEH2_END;
OUT PUNICODE_STRING ClassName,
IN BOOL Ansi)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
UNICODE_STRING CapturedClassName;
INT Ret = 0;
CapturedClassName = *ClassName;
/* get the class name */
- Ret = UserGetClassName(Window->Wnd->pcls,
+ Ret = UserGetClassName(Window->pcls,
&CapturedClassName,
Ansi);
PTHREADINFO ClipboardThread;
PTHREADINFO ClipboardOwnerThread;
-PWINDOW_OBJECT ClipboardWindow;
-PWINDOW_OBJECT ClipboardViewerWindow;
-PWINDOW_OBJECT ClipboardOwnerWindow;
+PWND ClipboardWindow;
+PWND ClipboardViewerWindow;
+PWND ClipboardOwnerWindow;
BOOL sendDrawClipboardMsg;
BOOL recentlySetClipboard;
BOOL delayedRender;
/* return the pointer to the prev window of the finded window,
if NULL does not exists in the chain */
PCLIPBOARDCHAINELEMENT FASTCALL
-IntIsWindowInChain(PWINDOW_OBJECT window)
+IntIsWindowInChain(PWND window)
{
PCLIPBOARDCHAINELEMENT wce = WindowsChain;
PCLIPBOARDCHAINELEMENT wce2 = WindowsChain;
while (wce2)
{
- DPRINT1("chain: %p\n", wce2->window->hSelf);
+ DPRINT1("chain: %p\n", wce2->window->head.h);
wce2 = wce2->next;
}
}
/* the new window always have to be the first in the chain */
PCLIPBOARDCHAINELEMENT FASTCALL
-IntAddWindowToChain(PWINDOW_OBJECT window)
+IntAddWindowToChain(PWND window)
{
PCLIPBOARDCHAINELEMENT wce = NULL;
}
PCLIPBOARDCHAINELEMENT FASTCALL
-IntRemoveWindowFromChain(PWINDOW_OBJECT window)
+IntRemoveWindowFromChain(PWND window)
{
PCLIPBOARDCHAINELEMENT wce = WindowsChain;
PCLIPBOARDCHAINELEMENT *link = &WindowsChain;
/* IntClipboardFreeWindow it's called when a window was destroyed */
VOID FASTCALL
-IntClipboardFreeWindow(PWINDOW_OBJECT window)
+IntClipboardFreeWindow(PWND window)
{
/* called from co_UserFreeWindow in window.c */
/* check if clipboard is not locked by this window, if yes, unlock it */
NtUserOpenClipboard(HWND hWnd, DWORD Unknown1)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL ret = FALSE;
UserEnterExclusive();
{
if (ClipboardOwnerWindow)
{
- if (ClipboardOwnerWindow->hSelf == hWnd)
+ if (ClipboardOwnerWindow->head.h == hWnd)
{
ret = TRUE;
}
if (ClipboardWindow)
{
- ret = ClipboardWindow->hSelf;
+ ret = ClipboardWindow->head.h;
}
UserLeave();
{
BOOL ret = FALSE;
PCLIPBOARDCHAINELEMENT w = NULL;
- PWINDOW_OBJECT removeWindow;
+ PWND removeWindow;
UserEnterExclusive();
removeWindow = UserGetWindowObject(hWndRemove);
// then they do the chain
/* WindowsChain->window may be NULL */
- LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->hSelf;
- DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->hSelf);
- co_IntSendMessage(WindowsChain->window->hSelf, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, lparam);
+ LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->head.h;
+ DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->head.h);
+ co_IntSendMessage(WindowsChain->window->head.h, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, lparam);
}
UserLeave();
if (ret && ClipboardOwnerWindow)
{
- DPRINT("Clipboard: WM_DESTROYCLIPBOARD to %p", ClipboardOwnerWindow->hSelf);
- co_IntSendMessage( ClipboardOwnerWindow->hSelf, WM_DESTROYCLIPBOARD, 0, 0);
+ DPRINT("Clipboard: WM_DESTROYCLIPBOARD to %p", ClipboardOwnerWindow->head.h);
+ co_IntSendMessage( ClipboardOwnerWindow->head.h, WM_DESTROYCLIPBOARD, 0, 0);
}
UserLeave();
/* tell owner what data needs to be rendered */
if (ClipboardOwnerWindow)
{
- ASSERT(ClipboardOwnerWindow->hSelf);
- co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
+ ASSERT(ClipboardOwnerWindow->head.h);
+ co_IntSendMessage(ClipboardOwnerWindow->head.h, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
data = intIsFormatAvailable(uFormat);
ASSERT(data->size);
ret = (HANDLE)(ULONG_PTR)data->size;
if (ClipboardOwnerWindow)
{
- ret = ClipboardOwnerWindow->hSelf;
+ ret = ClipboardOwnerWindow->head.h;
}
UserLeave();
if (WindowsChain)
{
- ret = WindowsChain->window->hSelf;
+ ret = WindowsChain->window->head.h;
}
UserLeave();
{
HWND ret = NULL;
PCLIPBOARDCHAINELEMENT newWC = NULL;
- PWINDOW_OBJECT window;
+ PWND window;
UserEnterExclusive();
if (newWC->next)
{
// return the next HWND available window in the chain
- ret = newWC->next->window->hSelf;
+ ret = newWC->next->window->head.h;
}
}
}
BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg)
{
- PWINDOW_OBJECT DesktopWindow;
+ PWND DesktopWindow;
PSYSTEM_CURSORINFO CurInfo;
HDC hDC;
MSG Msg;
/* Clip cursor position */
if (!CurInfo->bClipped)
- rcClip = DesktopWindow->Wnd->rcClient;
+ rcClip = DesktopWindow->rcClient;
else
rcClip = CurInfo->rcClip;
/* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
PSYSTEM_CURSORINFO CurInfo;
RECTL Rect;
- PWINDOW_OBJECT DesktopWindow = NULL;
+ PWND DesktopWindow = NULL;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserClipCursor\n");
{
CurInfo->bClipped = TRUE;
- RECTL_bIntersectRect(&CurInfo->rcClip, &Rect, &DesktopWindow->Wnd->rcWindow);
+ RECTL_bIntersectRect(&CurInfo->rcClip, &Rect, &DesktopWindow->rcWindow);
UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y, FALSE);
RETURN(TRUE);
static
LRESULT FASTCALL
IntClientShutdown(
- PWINDOW_OBJECT pWindow,
+ PWND pWindow,
WPARAM wParam,
LPARAM lParam
)
{
for (i = 0; List[i]; i++)
{
- PWINDOW_OBJECT WndChild;
+ PWND WndChild;
- if (!(WndChild = UserGetWindowObject(List[i])) || !WndChild->Wnd)
+ if (!(WndChild = UserGetWindowObject(List[i])))
continue;
if (wParam & MCS_QUERYENDSESSION)
{
- if (!co_IntSendMessage(WndChild->hSelf, WM_QUERYENDSESSION, 0, lParams))
+ if (!co_IntSendMessage(WndChild->head.h, WM_QUERYENDSESSION, 0, lParams))
{
lResult = MCSR_DONOTSHUTDOWN;
break;
}
else
{
- co_IntSendMessage(WndChild->hSelf, WM_ENDSESSION, KillTimers, lParams);
+ co_IntSendMessage(WndChild->head.h, WM_ENDSESSION, KillTimers, lParams);
if (KillTimers)
{
- DestroyTimersForWindow(WndChild->pti, WndChild);
+ DestroyTimersForWindow(WndChild->head.pti, WndChild);
}
lResult = MCSR_SHUTDOWNFINISHED;
}
*/
if (wParam & MCS_QUERYENDSESSION)
{
- if (!co_IntSendMessage(pWindow->hSelf, WM_QUERYENDSESSION, 0, lParams))
+ if (!co_IntSendMessage(pWindow->head.h, WM_QUERYENDSESSION, 0, lParams))
{
lResult = MCSR_DONOTSHUTDOWN;
}
}
else
{
- co_IntSendMessage(pWindow->hSelf, WM_ENDSESSION, KillTimers, lParams);
+ co_IntSendMessage(pWindow->head.h, WM_ENDSESSION, KillTimers, lParams);
if (KillTimers)
{
- DestroyTimersForWindow(pWindow->pti, pWindow);
+ DestroyTimersForWindow(pWindow->head.pti, pWindow);
}
lResult = MCSR_SHUTDOWNFINISHED;
}
*/
LRESULT FASTCALL
IntDefWindowProc(
- PWINDOW_OBJECT Window,
+ PWND Wnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam,
BOOL Ansi)
{
- PWND Wnd;
LRESULT lResult = 0;
if (Msg > WM_USER) return 0;
- Wnd = Window->Wnd;
- if (!Wnd) return 0;
-
switch (Msg)
{
case WM_SYSCOMMAND:
{
- DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Window->hSelf, wParam, lParam );
+ DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Wnd->head.h, wParam, lParam );
if (!ISITHOOKED(WH_CBT)) break;
lResult = co_HOOK_CallHooks(WH_CBT, HCBT_SYSCOMMAND, wParam, lParam);
break;
{
if ((Wnd->style & WS_VISIBLE) && wParam) break;
if (!(Wnd->style & WS_VISIBLE) && !wParam) break;
- if (!Window->spwndOwner) break;
+ if (!Wnd->spwndOwner) break;
if (LOWORD(lParam))
{
if (wParam)
else
Wnd->state |= WNDS_HIDDENPOPUP;
- co_WinPosShowWindow(Window, wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
+ co_WinPosShowWindow(Wnd, wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
}
}
break;
case WM_CLIENTSHUTDOWN:
- return IntClientShutdown(Window, wParam, lParam);
+ return IntClientShutdown(Wnd, wParam, lParam);
case WM_CBT:
{
_SEH2_END;
}
if (!lResult)
- lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Window->hSelf, lParam ? (LPARAM)&rt : 0);
- }
+ lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Wnd->head.h, lParam ? (LPARAM)&rt : 0);
+ }
break;
}
break;
return pdo->DesktopWindow;
}
-PWINDOW_OBJECT FASTCALL UserGetDesktopWindow(VOID)
+PWND FASTCALL UserGetDesktopWindow(VOID)
{
PDESKTOP pdo = IntGetActiveDesktop();
HDC FASTCALL
UserGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd)
{
- PWINDOW_OBJECT DesktopObject = 0;
+ PWND DesktopObject = 0;
HDC DesktopHDC = 0;
if (DcType == DC_TYPE_DIRECT)
VOID APIENTRY
UserRedrawDesktop()
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
UserEnterExclusive();
return NotifyCsrss(&Request, &Reply);
#else
- PWINDOW_OBJECT DesktopWindow;
PWND DesktopWnd;
- DesktopWindow = IntGetWindowObject(Desktop->DesktopWindow);
- if (! DesktopWindow)
+ DesktopWnd = IntGetWindowObject(Desktop->DesktopWindow);
+ if (! DesktopWnd)
{
return ERROR_INVALID_WINDOW_HANDLE;
}
- DesktopWnd = DesktopWindow->Wnd;
DesktopWnd->style &= ~WS_VISIBLE;
return STATUS_SUCCESS;
HBRUSH DesktopBrush, PreviousBrush;
HWND hWndDesktop;
BOOL doPatBlt = TRUE;
- PWINDOW_OBJECT WndDesktop;
+ PWND WndDesktop;
int len;
COLORREF color_old;
UINT align_old;
RETURN(FALSE);
}
- DesktopBrush = (HBRUSH)WndDesktop->Wnd->pcls->hbrBackground;
+ DesktopBrush = (HBRUSH)WndDesktop->pcls->hbrBackground;
/*
if (WinSta->hbmWallpaper != NULL)
{
- PWINDOW_OBJECT DeskWin;
+ PWND DeskWin;
DeskWin = UserGetWindowObject(hWndDesktop);
int x, y;
HDC hWallpaperDC;
- sz.cx = DeskWin->Wnd->rcWindow.right - DeskWin->Wnd->rcWindow.left;
- sz.cy = DeskWin->Wnd->rcWindow.bottom - DeskWin->Wnd->rcWindow.top;
+ sz.cx = DeskWin->rcWindow.right - DeskWin->rcWindow.left;
+ sz.cy = DeskWin->rcWindow.bottom - DeskWin->rcWindow.top;
if (WinSta->WallpaperMode == wmStretch ||
WinSta->WallpaperMode == wmTile)
LONG idObject,
LONG idChild)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(Event))
{
UserRefObjectCo(Window, &Ref);
- IntNotifyWinEvent( Event, Window->Wnd, idObject, idChild);
+ IntNotifyWinEvent( Event, Window, idObject, idChild);
UserDerefObjectCo(Window);
}
UserLeave();
VOID FASTCALL
co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
{
- PWINDOW_OBJECT WndPrev ;
+ PWND WndPrev ;
if (hWndPrev && (WndPrev = UserGetWindowObject(hWndPrev)))
{
co_IntSendMessageNoWait(hWndPrev, WM_NCACTIVATE, FALSE, 0);
co_IntSendMessageNoWait(hWndPrev, WM_ACTIVATE,
- MAKEWPARAM(WA_INACTIVE, WndPrev->Wnd->style & WS_MINIMIZE),
+ MAKEWPARAM(WA_INACTIVE, WndPrev->style & WS_MINIMIZE),
(LPARAM)hWnd);
}
}
co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
{
USER_REFERENCE_ENTRY Ref, RefPrev;
- PWINDOW_OBJECT Window, WindowPrev = NULL;
+ PWND Window, WindowPrev = NULL;
if ((Window = UserGetWindowObject(hWnd)))
{
co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (LPARAM) hWnd);
}
- if (Window->Wnd)
+ if (Window)
{ // Set last active for window and it's owner.
- Window->Wnd->hWndLastActive = hWnd;
- if (Window->Wnd->spwndOwner)
- Window->Wnd->spwndOwner->hWndLastActive = hWnd;
- Window->Wnd->state |= WNDS_ACTIVEFRAME;
+ Window->hWndLastActive = hWnd;
+ if (Window->spwndOwner)
+ Window->spwndOwner->hWndLastActive = hWnd;
+ Window->state |= WNDS_ACTIVEFRAME;
}
- if (WindowPrev && WindowPrev->Wnd)
- WindowPrev->Wnd->state &= ~WNDS_ACTIVEFRAME;
+ if (WindowPrev)
+ WindowPrev->state &= ~WNDS_ACTIVEFRAME;
if (Window && WindowPrev)
{
- PWINDOW_OBJECT cWindow;
+ PWND cWindow;
HWND *List, *phWnd;
HANDLE OldTID = IntGetWndThreadId(WindowPrev);
HANDLE NewTID = IntGetWndThreadId(Window);
DPRINT("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID);
- if (Window->Wnd->style & WS_MINIMIZE)
+ if (Window->style & WS_MINIMIZE)
{
DPRINT("Widow was minimized\n");
}
/* FIXME: WA_CLICKACTIVE */
co_IntSendMessageNoWait(hWnd, WM_ACTIVATE,
MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
- Window->Wnd->style & WS_MINIMIZE),
+ Window->style & WS_MINIMIZE),
(LPARAM)hWndPrev);
}
}
}
HWND FASTCALL
-IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner)
+IntFindChildWindowToOwner(PWND Root, PWND Owner)
{
HWND Ret;
- PWINDOW_OBJECT Child, OwnerWnd;
+ PWND Child, OwnerWnd;
for(Child = Root->spwndChild; Child; Child = Child->spwndNext)
{
if(OwnerWnd == Owner)
{
- Ret = Child->hSelf;
+ Ret = Child->head.h;
return Ret;
}
}
}
static BOOL FASTCALL
-co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWindow, BOOL MouseActivate)
+co_IntSetForegroundAndFocusWindow(PWND Wnd, PWND FocusWindow, BOOL MouseActivate)
{
- HWND hWnd = Window->hSelf;
+ HWND hWnd = Wnd->head.h;
HWND hWndPrev = NULL;
- HWND hWndFocus = FocusWindow->hSelf;
+ HWND hWndFocus = FocusWindow->head.h;
HWND hWndFocusPrev = NULL;
PUSER_MESSAGE_QUEUE PrevForegroundQueue;
- PWND Wnd;
- ASSERT_REFS_CO(Window);
+ ASSERT_REFS_CO(Wnd);
DPRINT("IntSetForegroundAndFocusWindow(%x, %x, %s)\n", hWnd, hWndFocus, MouseActivate ? "TRUE" : "FALSE");
- Wnd = Window->Wnd;
-
if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
DPRINT("Failed - Child\n");
}
if (0 == (Wnd->style & WS_VISIBLE) &&
- Window->pti->pEThread->ThreadsProcess != CsrProcess)
+ Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess)
{
DPRINT("Failed - Invisible\n");
return FALSE;
co_IntSendKillFocusMessages(hWndFocusPrev, hWndFocus);
- IntSetFocusMessageQueue(Window->pti->MessageQueue);
+ IntSetFocusMessageQueue(Wnd->head.pti->MessageQueue);
- if (Window->pti->MessageQueue)
+ if (Wnd->head.pti->MessageQueue)
{
- Window->pti->MessageQueue->ActiveWindow = hWnd;
+ Wnd->head.pti->MessageQueue->ActiveWindow = hWnd;
}
- if (FocusWindow->pti->MessageQueue)
+ if (FocusWindow->head.pti->MessageQueue)
{
- FocusWindow->pti->MessageQueue->FocusWindow = hWndFocus;
+ FocusWindow->head.pti->MessageQueue->FocusWindow = hWndFocus;
}
- if (PrevForegroundQueue != Window->pti->MessageQueue)
+ if (PrevForegroundQueue != Wnd->head.pti->MessageQueue)
{
/* FIXME: Send WM_ACTIVATEAPP to all thread windows. */
}
}
BOOL FASTCALL
-co_IntSetForegroundWindow(PWINDOW_OBJECT Window)//FIXME: can Window be NULL??
+co_IntSetForegroundWindow(PWND Window)//FIXME: can Window be NULL??
{
/*if (Window)*/ ASSERT_REFS_CO(Window);
}
BOOL FASTCALL
-co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
+co_IntMouseActivateWindow(PWND Wnd)
{
HWND Top;
- PWINDOW_OBJECT TopWindow;
+ PWND TopWindow;
USER_REFERENCE_ENTRY Ref;
- PWND Wnd;
- ASSERT_REFS_CO(Window);
+ ASSERT_REFS_CO(Wnd);
- Wnd = Window->Wnd;
if(Wnd->style & WS_DISABLED)
{
BOOL Ret;
- PWINDOW_OBJECT TopWnd;
- PWINDOW_OBJECT DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
+ PWND TopWnd;
+ PWND DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if(DesktopWindow)
{
- Top = IntFindChildWindowToOwner(DesktopWindow, Window);
+ Top = IntFindChildWindowToOwner(DesktopWindow, Wnd);
if((TopWnd = UserGetWindowObject(Top)))
{
UserRefObjectCo(TopWnd, &Ref);
}
- TopWindow = UserGetAncestor(Window, GA_ROOT);
+ TopWindow = UserGetAncestor(Wnd, GA_ROOT);
if (!TopWindow) return FALSE;
/* TMN: Check return valud from this function? */
UserRefObjectCo(TopWindow, &Ref);
- co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE);
+ co_IntSetForegroundAndFocusWindow(TopWindow, Wnd, TRUE);
UserDerefObjectCo(TopWindow);
}
HWND FASTCALL
-co_IntSetActiveWindow(PWINDOW_OBJECT Window OPTIONAL)
+co_IntSetActiveWindow(PWND Wnd OPTIONAL)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
HWND hWndPrev;
HWND hWnd = 0;
- PWND Wnd;
CBTACTIVATESTRUCT cbt;
- if (Window)
- ASSERT_REFS_CO(Window);
+ if (Wnd)
+ ASSERT_REFS_CO(Wnd);
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
ASSERT(ThreadQueue != 0);
- if (Window != 0)
+ if (Wnd != 0)
{
- Wnd = Window->Wnd;
if ((!(Wnd->style & WS_VISIBLE) &&
- Window->pti->pEThread->ThreadsProcess != CsrProcess) ||
+ Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) ||
(Wnd->style & (WS_POPUP | WS_CHILD)) == WS_CHILD)
{
return ThreadQueue ? 0 : ThreadQueue->ActiveWindow;
}
- hWnd = Window->hSelf;
+ hWnd = Wnd->head.h;
}
hWndPrev = ThreadQueue->ActiveWindow;
static
HWND FASTCALL
-co_IntSetFocusWindow(PWINDOW_OBJECT Window OPTIONAL)
+co_IntSetFocusWindow(PWND Window OPTIONAL)
{
HWND hWndPrev = 0;
PTHREADINFO pti;
if (Window != 0)
{
- if (hWndPrev == Window->hSelf)
+ if (hWndPrev == Window->head.h)
{
return hWndPrev;
}
- if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->hSelf, (LPARAM)hWndPrev))
+ if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->head.h, (LPARAM)hWndPrev))
return 0;
- ThreadQueue->FocusWindow = Window->hSelf;
+ ThreadQueue->FocusWindow = Window->head.h;
- co_IntSendKillFocusMessages(hWndPrev, Window->hSelf);
- co_IntSendSetFocusMessages(hWndPrev, Window->hSelf);
+ co_IntSendKillFocusMessages(hWndPrev, Window->head.h);
+ co_IntSendSetFocusMessages(hWndPrev, Window->head.h);
}
else
{
if (hWnd)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
HWND hWndPrev;
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
- if (Window->pti->MessageQueue != ThreadQueue)
+ if (Window->head.pti->MessageQueue != ThreadQueue)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
RETURN( 0);
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
- PWINDOW_OBJECT Window;
+ PWND Window;
HWND hWndPrev;
DECLARE_RETURN(HWND);
if((Window = UserGetWindowObject(hWnd)))
{
- if(Window->pti->MessageQueue != ThreadQueue)
+ if(Window->head.pti->MessageQueue != ThreadQueue)
{
RETURN(NULL);
}
-HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
+HWND FASTCALL co_UserSetFocus(PWND Wnd OPTIONAL)
{
- if (Window)
+ if (Wnd)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
HWND hWndPrev;
- PWINDOW_OBJECT TopWnd;
+ PWND TopWnd;
USER_REFERENCE_ENTRY Ref;
- PWND Wnd;
- ASSERT_REFS_CO(Window);
+ ASSERT_REFS_CO(Wnd);
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
- Wnd = Window->Wnd;
if (Wnd->style & (WS_MINIMIZE | WS_DISABLED))
{
return( (ThreadQueue ? ThreadQueue->FocusWindow : 0));
}
- if (Window->pti->MessageQueue != ThreadQueue)
+ if (Wnd->head.pti->MessageQueue != ThreadQueue)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return( 0);
}
- TopWnd = UserGetAncestor(Window, GA_ROOT);
- if (TopWnd && TopWnd->hSelf != UserGetActiveWindow())
+ TopWnd = UserGetAncestor(Wnd, GA_ROOT);
+ if (TopWnd && TopWnd->head.h != UserGetActiveWindow())
{
-// PWINDOW_OBJECT WndTops = UserGetWindowObject(hWndTop);
+// PWND WndTops = UserGetWindowObject(hWndTop);
UserRefObjectCo(TopWnd, &Ref);
co_IntSetActiveWindow(TopWnd);
UserDerefObjectCo(TopWnd);
}
- hWndPrev = co_IntSetFocusWindow(Window);
+ hWndPrev = co_IntSetFocusWindow(Wnd);
return( hWndPrev);
}
HWND APIENTRY
NtUserSetFocus(HWND hWnd)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(HWND);
HWND ret;
VOID FASTCALL
-UnregisterWindowHotKeys(PWINDOW_OBJECT Window)
+UnregisterWindowHotKeys(PWND Window)
{
PHOT_KEY_ITEM HotKeyItem, tmp;
LIST_FOR_EACH_SAFE(HotKeyItem, tmp, &gHotkeyList, HOT_KEY_ITEM, ListEntry)
{
- if (HotKeyItem->hWnd == Window->hSelf)
+ if (HotKeyItem->hWnd == Window->head.h)
{
RemoveEntryList (&HotKeyItem->ListEntry);
ExFreePool (HotKeyItem);
UINT vk)
{
PHOT_KEY_ITEM HotKeyItem;
- PWINDOW_OBJECT Window;
+ PWND Window;
PETHREAD HotKeyThread;
DECLARE_RETURN(BOOL);
{
RETURN( FALSE);
}
- HotKeyThread = Window->pti->pEThread;
+ HotKeyThread = Window->head.pti->pEThread;
}
/* Check for existing hotkey */
NtUserUnregisterHotKey(HWND hWnd, int id)
{
PHOT_KEY_ITEM HotKeyItem;
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserUnregisterHotKey\n");
static VOID APIENTRY
IntKeyboardSendWinKeyMsg()
{
- PWINDOW_OBJECT Window;
+ PWND Window;
MSG Mesg;
if (!(Window = UserGetWindowObject(InputWindowStation->ShellWindow)))
Mesg.lParam = 0;
/* The QS_HOTKEY is just a guess */
- MsqPostMessage(Window->pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
+ MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
}
static VOID APIENTRY
#include <debug.h>
PMENU_OBJECT FASTCALL
-IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu);
+IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu);
{
if(Menu)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PWINSTATION_OBJECT WindowStation;
NTSTATUS Status;
Window = UserGetWindowObject(Menu->MenuInfo.Wnd);
if (Window)
{
- Window->Wnd->IDMenu = 0;
+ Window->IDMenu = 0;
}
}
// UserDereferenceObject(Menu);
}
BOOL FASTCALL
-IntHiliteMenuItem(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject,
+IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject,
UINT uItemHilite, UINT uHilite)
{
PMENU_ITEM MenuItem;
}
VOID FASTCALL
-co_IntInitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
+co_IntInitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
UINT Flags)
{
/* FIXME - hide caret */
if(!(Flags & TPM_NONOTIFY))
- co_IntSendMessage(Window->hSelf, WM_SETCURSOR, (WPARAM)Window->hSelf, HTCAPTION);
+ co_IntSendMessage(Window->head.h, WM_SETCURSOR, (WPARAM)Window->head.h, HTCAPTION);
/* FIXME - send WM_SETCURSOR message */
if(!(Flags & TPM_NONOTIFY))
- co_IntSendMessage(Window->hSelf, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
+ co_IntSendMessage(Window->head.h, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
}
VOID FASTCALL
-co_IntExitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
+co_IntExitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
UINT Flags)
{
if(!(Flags & TPM_NONOTIFY))
- co_IntSendMessage(Window->hSelf, WM_EXITMENULOOP, 0 /* FIXME */, 0);
+ co_IntSendMessage(Window->head.h, WM_EXITMENULOOP, 0 /* FIXME */, 0);
/* FIXME - Show caret again */
}
INT FASTCALL
-IntTrackMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, INT x, INT y,
+IntTrackMenu(PMENU_OBJECT Menu, PWND Window, INT x, INT y,
RECTL lprect)
{
return 0;
}
BOOL FASTCALL
-co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window,
+co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWND Window,
UINT Flags, POINT *Pos, UINT MenuPos, RECTL *ExcludeRect)
{
co_IntInitTracking(Window, Menu, TRUE, Flags);
}
BOOLEAN APIENTRY
-intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
+intGetTitleBarInfo(PWND pWindowObject, PTITLEBARINFO bti)
{
DWORD dwStyle = 0;
bti->rgstate[0] = STATE_SYSTEM_FOCUSABLE;
- dwStyle = pWindowObject->Wnd->style;
- dwExStyle = pWindowObject->Wnd->ExStyle;
+ dwStyle = pWindowObject->style;
+ dwExStyle = pWindowObject->ExStyle;
bti->rcTitleBar.top = 0;
bti->rcTitleBar.left = 0;
- bti->rcTitleBar.right = pWindowObject->Wnd->rcWindow.right - pWindowObject->Wnd->rcWindow.left;
- bti->rcTitleBar.bottom = pWindowObject->Wnd->rcWindow.bottom - pWindowObject->Wnd->rcWindow.top;
+ bti->rcTitleBar.right = pWindowObject->rcWindow.right - pWindowObject->rcWindow.left;
+ bti->rcTitleBar.bottom = pWindowObject->rcWindow.bottom - pWindowObject->rcWindow.top;
/* is it iconiced ? */
if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
}
}
- bti->rcTitleBar.top += pWindowObject->Wnd->rcWindow.top;
- bti->rcTitleBar.left += pWindowObject->Wnd->rcWindow.left;
- bti->rcTitleBar.right += pWindowObject->Wnd->rcWindow.left;
+ bti->rcTitleBar.top += pWindowObject->rcWindow.top;
+ bti->rcTitleBar.left += pWindowObject->rcWindow.left;
+ bti->rcTitleBar.right += pWindowObject->rcWindow.left;
bti->rcTitleBar.bottom = bti->rcTitleBar.top;
if (dwExStyle & WS_EX_TOOLWINDOW)
{
bti->rgstate[4] = STATE_SYSTEM_INVISIBLE;
}
- if (pWindowObject->Wnd->pcls->style & CS_NOCLOSE)
+ if (pWindowObject->pcls->style & CS_NOCLOSE)
{
bti->rgstate[5] = STATE_SYSTEM_UNAVAILABLE;
}
return retValue;
}
-/* FUNCTIONS *****************************************************************/
-
-
-/*
- * @implemented
- */
-DWORD
-APIENTRY
-NtUserBuildMenuItemList(
- HMENU hMenu,
- VOID* Buffer,
- ULONG nBufSize,
- DWORD Reserved)
+DWORD FASTCALL
+UserInsertMenuItem(
+ PMENU_OBJECT Menu,
+ UINT uItem,
+ BOOL fByPosition,
+ LPCMENUITEMINFOW UnsafeItemInfo)
{
- DWORD res = -1;
- PMENU_OBJECT Menu;
- DECLARE_RETURN(DWORD);
-
- DPRINT("Enter NtUserBuildMenuItemList\n");
- UserEnterExclusive();
+ NTSTATUS Status;
+ ROSMENUITEMINFO ItemInfo;
- if(!(Menu = UserGetMenuObject(hMenu)))
+ /* Try to copy the whole MENUITEMINFOW structure */
+ Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
+ if (NT_SUCCESS(Status))
{
- RETURN( (DWORD)-1);
+ if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
+ && FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
+ {
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
}
- if(Buffer)
- {
- res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
- }
- else
+ /* Try to copy without last field (not present in older versions) */
+ Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
+ if (NT_SUCCESS(Status))
{
- res = Menu->MenuInfo.MenuItemCount;
+ if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
+ {
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ ItemInfo.hbmpItem = (HBITMAP)0;
+ return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
}
- RETURN( res);
-
-CLEANUP:
- DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
+ SetLastNtError(Status);
+ return FALSE;
}
+/* FUNCTIONS *****************************************************************/
+
/*
* @implemented
*/
END_CLEANUP;
}
-
HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
{
PWINSTATION_OBJECT WinStaObject;
return (HMENU)Handle;
}
-
/*
* @implemented
*/
HWND hwnd,
PTITLEBARINFO bti)
{
- PWINDOW_OBJECT WindowObject;
+ PWND WindowObject;
TITLEBARINFO bartitleinfo;
DECLARE_RETURN(BOOLEAN);
BOOLEAN retValue = TRUE;
END_CLEANUP;
}
-
-
/*
* @implemented
*/
END_CLEANUP;
}
-
/*
* @implemented
*/
END_CLEANUP;
}
-
-/*
- * @implemented
- */
-DWORD APIENTRY
-UserInsertMenuItem(
- HMENU hMenu,
- UINT uItem,
- BOOL fByPosition,
- LPCMENUITEMINFOW UnsafeItemInfo)
-{
- PMENU_OBJECT Menu;
- NTSTATUS Status;
- ROSMENUITEMINFO ItemInfo;
- DECLARE_RETURN(DWORD);
-
- DPRINT("Enter UserInsertMenuItem\n");
- UserEnterExclusive();
-
- if(!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN( FALSE);
- }
-
- /* Try to copy the whole MENUITEMINFOW structure */
- Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
- if (NT_SUCCESS(Status))
- {
- if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
- && FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- RETURN( FALSE);
- }
- RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
- }
-
- /* Try to copy without last field (not present in older versions) */
- Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
- if (NT_SUCCESS(Status))
- {
- if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- RETURN( FALSE);
- }
- ItemInfo.hbmpItem = (HBITMAP)0;
- RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
- }
-
- SetLastNtError(Status);
- RETURN( FALSE);
-
-CLEANUP:
- DPRINT("Leave UserInsertMenuItem, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
/*
* @unimplemented
*/
return 0;
}
-
-/*
- * @implemented
- */
-UINT APIENTRY
-NtUserGetMenuDefaultItem(
- HMENU hMenu,
- UINT fByPos,
- UINT gmdiFlags)
-{
- PMENU_OBJECT Menu;
- DWORD gismc = 0;
- DECLARE_RETURN(UINT);
-
- DPRINT("Enter NtUserGetMenuDefaultItem\n");
- UserEnterExclusive();
-
- if(!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN(-1);
- }
-
- RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
-
-CLEANUP:
- DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
/*
* @implemented
*/
BOOL Res = TRUE;
PMENU_OBJECT MenuObject;
PMENU_ITEM mi;
- PWINDOW_OBJECT WindowObject;
+ PWND WindowObject;
HMENU hMenu;
POINT Offset;
RECTL Rect;
RETURN(FALSE);
}
- hMenu = (HMENU)(DWORD_PTR)WindowObject->Wnd->IDMenu;
+ hMenu = (HMENU)(DWORD_PTR)WindowObject->IDMenu;
if (!(MenuObject = UserGetMenuObject(hMenu)))
{
}
else
{
- PWINDOW_OBJECT SubWinObj;
+ PWND SubWinObj;
if (!(SubWinObj = UserGetWindowObject(SubMenuObject->MenuInfo.Wnd)))
{
Res = FALSE;
}
else
{
- PWINDOW_OBJECT SysWinObj;
+ PWND SysWinObj;
if (!(SysWinObj = UserGetWindowObject(SysMenuObject->MenuInfo.Wnd)))
{
Res = FALSE;
PRECTL lprcItem)
{
ROSMENUINFO mi;
- PWINDOW_OBJECT ReferenceWnd;
+ PWND ReferenceWnd;
LONG XMove, YMove;
RECTL Rect;
NTSTATUS Status;
if(MenuItem->fType & MF_POPUP)
{
- XMove = ReferenceWnd->Wnd->rcClient.left;
- YMove = ReferenceWnd->Wnd->rcClient.top;
+ XMove = ReferenceWnd->rcClient.left;
+ YMove = ReferenceWnd->rcClient.top;
}
else
{
- XMove = ReferenceWnd->Wnd->rcWindow.left;
- YMove = ReferenceWnd->Wnd->rcWindow.top;
+ XMove = ReferenceWnd->rcWindow.left;
+ YMove = ReferenceWnd->rcWindow.top;
}
Rect.left += XMove;
END_CLEANUP;
}
-
/*
* @implemented
*/
UINT uHilite)
{
PMENU_OBJECT Menu;
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(BOOLEAN);
DPRINT("Enter NtUserHiliteMenuItem\n");
RETURN(FALSE);
}
- if(Window->Wnd->IDMenu == (UINT)(UINT_PTR)hMenu)
+ if(Window->IDMenu == (UINT)(UINT_PTR)hMenu)
{
RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
}
END_CLEANUP;
}
-
static
BOOL FASTCALL
UserMenuInfo(
return( Res);
}
-/*
- * @implemented
- */
-BOOL
-APIENTRY
-NtUserMenuInfo(
- HMENU hMenu,
- PROSMENUINFO UnsafeMenuInfo,
- BOOL SetOrGet)
-{
- PMENU_OBJECT Menu;
- DECLARE_RETURN(BOOL);
-
- DPRINT("Enter NtUserMenuInfo\n");
- UserEnterShared();
-
- if (!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN(FALSE);
- }
-
- RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
-
-CLEANUP:
- DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
-
/*
* @implemented
*/
DWORD Y)
{
PMENU_OBJECT Menu;
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PMENU_ITEM mi;
int i;
DECLARE_RETURN(int);
RETURN( -1);
}
- X -= Window->Wnd->rcWindow.left;
- Y -= Window->Wnd->rcWindow.top;
+ X -= Window->rcWindow.left;
+ Y -= Window->rcWindow.top;
mi = Menu->MenuItemList;
for (i = 0; NULL != mi; i++)
END_CLEANUP;
}
-
-
static
BOOL FASTCALL
UserMenuItemInfo(
return( Ret);
}
-
-
-/*
- * @implemented
- */
-BOOL
-APIENTRY
-NtUserMenuItemInfo(
- HMENU hMenu,
- UINT Item,
- BOOL ByPosition,
- PROSMENUITEMINFO UnsafeItemInfo,
- BOOL SetOrGet)
-{
- PMENU_OBJECT Menu;
- DECLARE_RETURN(BOOL);
-
- DPRINT("Enter NtUserMenuItemInfo\n");
- UserEnterExclusive();
-
- if (!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN(FALSE);
- }
-
- RETURN( UserMenuItemInfo(Menu, Item, ByPosition, UnsafeItemInfo, SetOrGet));
-
-CLEANUP:
- DPRINT("Leave NtUserMenuItemInfo, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-
-}
-
-
/*
* @implemented
*/
}
-
/*
* @implemented
*/
END_CLEANUP;
}
-
-
/*
* @implemented
*/
END_CLEANUP;
}
-
/*
* @implemented
*/
END_CLEANUP;
}
-
/*
- * @unimplemented
+ * @implemented
*/
-DWORD APIENTRY
+BOOL APIENTRY
NtUserThunkedMenuInfo(
HMENU hMenu,
LPCMENUINFO lpcmi)
{
- UNIMPLEMENTED
- /* This function seems just to call SetMenuInfo() */
- return 0;
-}
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(BOOL);
+ DPRINT("Enter NtUserThunkedMenuInfo\n");
+ UserEnterExclusive();
+
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
+
+ RETURN(UserMenuInfo(Menu, (PROSMENUINFO)lpcmi, TRUE));
+
+CLEANUP:
+ DPRINT("Leave NtUserThunkedMenuInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
/*
- * @unimplemented
+ * @implemented
*/
-DWORD APIENTRY
+BOOL APIENTRY
NtUserThunkedMenuItemInfo(
HMENU hMenu,
UINT uItem,
LPMENUITEMINFOW lpmii,
PUNICODE_STRING lpszCaption)
{
+ PMENU_OBJECT Menu;
+ NTSTATUS Status;
+ UNICODE_STRING lstrCaption;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserThunkedMenuItemInfo\n");
+ UserEnterExclusive();
/* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
- if bInsert == TRUE call NtUserInsertMenuItem() else NtUserSetMenuItemInfo() */
+ if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo() */
- if (bInsert) return UserInsertMenuItem(hMenu, uItem, fByPosition, lpmii);
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
- UNIMPLEMENTED
- return 0;
-}
+ lstrCaption.Buffer = NULL;
+
+ /* Check if we got a Caption */
+ if (lpszCaption)
+ {
+ /* Copy the string to kernel mode */
+ Status = ProbeAndCaptureUnicodeString( &lstrCaption,
+ UserMode,
+ lpszCaption);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to capture MenuItem Caption (status 0x%08x)\n",Status);
+ SetLastNtError(Status);
+ RETURN(FALSE);
+ }
+ }
+
+ if (bInsert) RETURN( UserInsertMenuItem(Menu, uItem, fByPosition, lpmii));
+ RETURN( UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE));
+
+CLEANUP:
+ DPRINT("Leave NtUserThunkedMenuItemInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
/*
* @implemented
}
+////// ReactOS NtUserBad
+/*
+ * @implemented
+ */
+DWORD
+APIENTRY
+NtUserBuildMenuItemList(
+ HMENU hMenu,
+ VOID* Buffer,
+ ULONG nBufSize,
+ DWORD Reserved)
+{
+ DWORD res = -1;
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(DWORD);
+
+ DPRINT("Enter NtUserBuildMenuItemList\n");
+ UserEnterExclusive();
+
+ if(!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN( (DWORD)-1);
+ }
+
+ if(Buffer)
+ {
+ res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
+ }
+ else
+ {
+ res = Menu->MenuInfo.MenuItemCount;
+ }
+
+ RETURN( res);
+
+CLEANUP:
+ DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+UINT APIENTRY
+NtUserGetMenuDefaultItem(
+ HMENU hMenu,
+ UINT fByPos,
+ UINT gmdiFlags)
+{
+ PMENU_OBJECT Menu;
+ DWORD gismc = 0;
+ DECLARE_RETURN(UINT);
+
+ DPRINT("Enter NtUserGetMenuDefaultItem\n");
+ UserEnterExclusive();
+
+ if(!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(-1);
+ }
+
+ RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
+
+CLEANUP:
+ DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+APIENTRY
+NtUserMenuInfo(
+ HMENU hMenu,
+ PROSMENUINFO UnsafeMenuInfo,
+ BOOL SetOrGet)
+{
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserMenuInfo\n");
+ UserEnterShared();
+
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
+
+ RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
+
+CLEANUP:
+ DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+APIENTRY
+NtUserMenuItemInfo(
+ HMENU hMenu,
+ UINT Item,
+ BOOL ByPosition,
+ PROSMENUITEMINFO UnsafeItemInfo,
+ BOOL SetOrGet)
+{
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserMenuItemInfo\n");
+ UserEnterExclusive();
+
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
+
+ RETURN( UserMenuItemInfo(Menu, Item, ByPosition, UnsafeItemInfo, SetOrGet));
+
+CLEANUP:
+ DPRINT("Leave NtUserMenuItemInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+
+}
+
/* EOF */
VOID
FASTCALL
IntCallWndProc
-( PWINDOW_OBJECT Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
+( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
BOOL SameThread = FALSE;
- if (Window->pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
+ if (Window->head.pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
SameThread = TRUE;
- if ((!SameThread && (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROC))) ||
+ if ((!SameThread && (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROC))) ||
(SameThread && ISITHOOKED(WH_CALLWNDPROC)) )
{
CWPSTRUCT CWP;
VOID
FASTCALL
IntCallWndProcRet
-( PWINDOW_OBJECT Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
+( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
{
BOOL SameThread = FALSE;
- if (Window->pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
+ if (Window->head.pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
SameThread = TRUE;
- if ((!SameThread && (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROCRET))) ||
+ if ((!SameThread && (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROCRET))) ||
(SameThread && ISITHOOKED(WH_CALLWNDPROCRET)) )
{
CWPRETSTRUCT CWPR;
PMSGMEMORY MsgMemoryEntry;
INT lParamBufferSize;
LPARAM lParamPacked;
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
if (pMsg->hwnd)
{
Window = UserGetWindowObject(pMsg->hwnd);
- if (!Window || !Window->Wnd) return 0;
+ if (!Window) return 0;
}
if (((pMsg->message == WM_SYSTIMER) ||
}
}
// Need a window!
- if ( !Window || !Window->Wnd ) return 0;
+ if ( !Window ) return 0;
/* See if this message type is present in the table */
MsgMemoryEntry = FindMsgMemory(pMsg->message);
return 0;
}
- retval = co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
- !Window->Wnd->Unicode,
+ retval = co_IntCallWindowProc( Window->lpfnWndProc,
+ !Window->Unicode,
pMsg->hwnd,
pMsg->message,
pMsg->wParam,
co_IntActivateWindowMouse(
PUSER_MESSAGE_QUEUE ThreadQueue,
LPMSG Msg,
- PWINDOW_OBJECT MsgWindow,
+ PWND MsgWindow,
USHORT *HitTest)
{
ULONG Result;
- PWINDOW_OBJECT Parent;
+ PWND Parent;
ASSERT_REFS_CO(MsgWindow);
Parent = IntGetParent(MsgWindow);//fixme: deref retval?
/* If no parent window, pass MsgWindows HWND as wParam. Fixes bug #3111 */
- Result = co_IntSendMessage(MsgWindow->hSelf,
+ Result = co_IntSendMessage(MsgWindow->head.h,
WM_MOUSEACTIVATE,
- (WPARAM) (Parent ? Parent->hSelf : MsgWindow->hSelf),
+ (WPARAM) (Parent ? Parent->head.h : MsgWindow->head.h),
(LPARAM)MAKELONG(*HitTest, Msg->message)
);
USHORT *HitTest,
BOOL Remove)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
USER_REFERENCE_ENTRY Ref, DesktopRef;
if(!(Window = UserGetWindowObject(Msg->hwnd)))
UserRefObjectCo(Window, &Ref);
- if ( ThreadQueue == Window->pti->MessageQueue &&
- ThreadQueue->CaptureWindow != Window->hSelf)
+ if ( ThreadQueue == Window->head.pti->MessageQueue &&
+ ThreadQueue->CaptureWindow != Window->head.h)
{
/* only send WM_NCHITTEST messages if we're not capturing the window! */
if (Remove )
{
- *HitTest = co_IntSendMessage(Window->hSelf, WM_NCHITTEST, 0,
+ *HitTest = co_IntSendMessage(Window->head.h, WM_NCHITTEST, 0,
MAKELONG(Msg->pt.x, Msg->pt.y));
}
/* else we are going to see this message again, but then with Remove == TRUE */
if (*HitTest == (USHORT)HTTRANSPARENT)
{
- PWINDOW_OBJECT DesktopWindow;
+ PWND DesktopWindow;
HWND hDesktop = IntGetDesktopWindow();
if ((DesktopWindow = UserGetWindowObject(hDesktop)))
{
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
UserRefObjectCo(DesktopWindow, &DesktopRef);
- co_WinPosWindowFromPoint(DesktopWindow, Window->pti->MessageQueue, &Msg->pt, &Wnd);
+ co_WinPosWindowFromPoint(DesktopWindow, Window->head.pti->MessageQueue, &Msg->pt, &Wnd);
if (Wnd)
{
if (Wnd != Window)
{
/* post the message to the other window */
- Msg->hwnd = Wnd->hSelf;
- if(!(Wnd->state & WINDOWSTATUS_DESTROYING))
+ Msg->hwnd = Wnd->head.h;
+ if(!(Wnd->state & WNDS_DESTROYED))
{
- MsqPostMessage(Wnd->pti->MessageQueue, Msg, FALSE,
+ MsqPostMessage(Wnd->head.pti->MessageQueue, Msg, FALSE,
Msg->message == WM_MOUSEMOVE ? QS_MOUSEMOVE :
QS_MOUSEBUTTON);
}
{
/* generate double click messages, if necessary */
if ((((*HitTest) != HTCLIENT) ||
- (Window->Wnd->pcls->style & CS_DBLCLKS)) &&
+ (Window->pcls->style & CS_DBLCLKS)) &&
MsqIsDblClk(Msg, Remove))
{
Msg->message += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
(((*HitTest) == HTCAPTION) || ((*HitTest) == HTSYSMENU)) )
{
Msg->message = WM_CONTEXTMENU;
- Msg->wParam = (WPARAM)Window->hSelf;
+ Msg->wParam = (WPARAM)Window->head.h;
}
else
{
{
/* NOTE: Msg->pt should remain in screen coordinates. -- FiN */
Msg->lParam = MAKELONG(
- Msg->pt.x - (WORD)Window->Wnd->rcClient.left,
- Msg->pt.y - (WORD)Window->Wnd->rcClient.top);
+ Msg->pt.x - (WORD)Window->rcClient.left,
+ Msg->pt.y - (WORD)Window->rcClient.top);
}
}
*/
BOOL FASTCALL
co_IntPeekMessage( PUSER_MESSAGE Msg,
- PWINDOW_OBJECT Window,
+ PWND Window,
UINT MsgFilterMin,
UINT MsgFilterMax,
UINT RemoveMsg )
if(RemoveMessages)
{
- PWINDOW_OBJECT MsgWindow = NULL;
+ PWND MsgWindow = NULL;
/* Mouse message process */
}
static BOOL FASTCALL
-co_IntWaitMessage( PWINDOW_OBJECT Window,
+co_IntWaitMessage( PWND Window,
UINT MsgFilterMin,
UINT MsgFilterMax )
{
BOOL bGMSG )
{
BOOL Present;
- PWINDOW_OBJECT Window;
+ PWND Window;
USER_MESSAGE Msg;
if ( hWnd == HWND_TOPMOST ||
}
else
{
- Window = (PWINDOW_OBJECT)hWnd;
+ Window = (PWND)hWnd;
}
if (MsgFilterMax < MsgFilterMin)
if (Wnd == HWND_BROADCAST)
{
HWND *List;
- PWINDOW_OBJECT DesktopWindow;
+ PWND DesktopWindow;
ULONG i;
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
}
else
{
- PWINDOW_OBJECT Window;
+ PWND Window;
Window = UserGetWindowObject(Wnd);
- if ( !Window || !Window->Wnd )
+ if ( !Window )
{
return FALSE;
}
- pti = Window->Wnd->head.pti;
+ pti = Window->head.pti;
if ( pti->TIF_flags & TIF_INCLEANUP )
{
DPRINT1("Attempted to post message to window 0x%x when the thread is in cleanup!\n", Wnd);
return FALSE;
}
- if ( Window->state & WINDOWSTATUS_DESTROYING )
+ if ( Window->state & WNDS_DESTROYED )
{
DPRINT1("Attempted to post message to window 0x%x that is being destroyed!\n", Wnd);
/* FIXME - last error code? */
if (WM_QUIT == Msg)
{
- MsqPostQuitMessage(Window->pti->MessageQueue, wParam);
+ MsqPostQuitMessage(Window->head.pti->MessageQueue, wParam);
}
else
{
Message.pt = gpsi->ptCursor;
KeQueryTickCount(&LargeTickCount);
pti->timeLast = Message.time = MsqCalculateMessageTime(&LargeTickCount);
- MsqPostMessage(Window->pti->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
+ MsqPostMessage(Window->head.pti->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
}
}
return TRUE;
{
ULONG_PTR Result;
NTSTATUS Status;
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PMSGMEMORY MsgMemoryEntry;
INT lParamBufferSize;
LPARAM lParamPacked;
IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
if ( NULL != Win32Thread &&
- Window->pti->MessageQueue == Win32Thread->MessageQueue)
+ Window->head.pti->MessageQueue == Win32Thread->MessageQueue)
{
if (Win32Thread->TIF_flags & TIF_INCLEANUP)
{
RETURN( FALSE);
}
- Result = (ULONG_PTR)co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
- !Window->Wnd->Unicode,
+ Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
+ !Window->Unicode,
hWnd,
Msg,
wParam,
RETURN( TRUE);
}
- if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->pti->MessageQueue))
+ if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti->MessageQueue))
{
/* FIXME - Set a LastError? */
RETURN( FALSE);
}
- if (Window->state & WINDOWSTATUS_DESTROYING)
+ if (Window->state & WNDS_DESTROYED)
{
/* FIXME - last error? */
DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
do
{
- Status = co_MsqSendMessage( Window->pti->MessageQueue,
+ Status = co_MsqSendMessage( Window->head.pti->MessageQueue,
hWnd,
Msg,
wParam,
}
while ((STATUS_TIMEOUT == Status) &&
(uFlags & SMTO_NOTIMEOUTIFNOTHUNG) &&
- !MsqIsHung(Window->pti->MessageQueue));
+ !MsqIsHung(Window->head.pti->MessageQueue));
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
UINT uTimeout,
ULONG_PTR *uResult )
{
- PWINDOW_OBJECT DesktopWindow;
+ PWND DesktopWindow;
HWND *Children;
HWND *Child;
ULONG_PTR *uResult)
{
ULONG_PTR Result;
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PMSGMEMORY MsgMemoryEntry;
INT lParamBufferSize;
LPARAM lParamPacked;
UserRefObjectCo(Window, &Ref);
- if (Window->state & WINDOWSTATUS_DESTROYING)
+ if (Window->state & WNDS_DESTROYED)
{
/* FIXME - last error? */
DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
lParamBufferSize = MsgMemorySize(MsgMemoryEntry, wParam, lParam);
}
- if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->pti->MessageQueue != Win32Thread->MessageQueue)))
+ if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->head.pti->MessageQueue != Win32Thread->MessageQueue)))
{
DPRINT1("Failed to pack message parameters\n");
RETURN( FALSE);
}
/* If this is not a callback and it can be sent now, then send it. */
- if ((Window->pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
+ if ((Window->head.pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
{
- Result = (ULONG_PTR)co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
- !Window->Wnd->Unicode,
+ Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
+ !Window->Unicode,
hWnd,
Msg,
wParam,
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
- if ((Window->pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
+ if ((Window->head.pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
{
if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE)))
{
Message->Result = 0;
Message->SenderQueue = NULL; //Win32Thread->MessageQueue;
- IntReferenceMessageQueue(Window->pti->MessageQueue);
+ IntReferenceMessageQueue(Window->head.pti->MessageQueue);
Message->CompletionCallback = CompletionCallback;
Message->CompletionCallbackContext = CompletionCallbackContext;
Message->HookMessage = MSQ_NORMAL | MSQ_SENTNOWAIT;
Message->HasPackedLParam = (lParamBufferSize > 0);
- InsertTailList(&Window->pti->MessageQueue->SentMessagesListHead, &Message->ListEntry);
- IntDereferenceMessageQueue(Window->pti->MessageQueue);
+ InsertTailList(&Window->head.pti->MessageQueue->SentMessagesListHead, &Message->ListEntry);
+ IntDereferenceMessageQueue(Window->head.pti->MessageQueue);
RETURN(TRUE);
{
ULONG_PTR Result;
PTHREADINFO pti;
- PWINDOW_OBJECT Window;
+ PWND Window;
if ( hWnd == HWND_BROADCAST )
{
pti = PsGetCurrentThreadWin32Thread();
- if ( Window->pti->MessageQueue != pti->MessageQueue &&
+ if ( Window->head.pti->MessageQueue != pti->MessageQueue &&
FindMsgMemory(Msg) == 0 )
{
Result = UserPostMessage(hWnd, Msg, wParam, lParam);
PTHREADINFO pti;
LRESULT Result = TRUE;
NTSTATUS Status;
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
NTUSERSENDMESSAGEINFO Info;
MSG UserModeMsg;
MSG KernelModeMsg;
if (HWND_BROADCAST != hWnd)
{
Window = UserGetWindowObject(hWnd);
- if ( !Window || !Window->Wnd )
+ if ( !Window )
{
/* Tell usermode to not touch this one */
Info.HandledByKernel = TRUE;
}
/* Check for an exiting window. */
- if (Window && Window->state & WINDOWSTATUS_DESTROYING)
+ if (Window && Window->state & WNDS_DESTROYED)
{
DPRINT1("co_IntDoSendMessage Window Exiting!\n");
}
// This is checked in user mode!!!!!!!
if ( HWND_BROADCAST != hWnd &&
NULL != pti &&
- Window->pti->MessageQueue == pti->MessageQueue &&
+ Window->head.pti->MessageQueue == pti->MessageQueue &&
!ISITHOOKED(WH_CALLWNDPROC) &&
!ISITHOOKED(WH_CALLWNDPROCRET) &&
( Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST ) )
sizeof(BOOL));
if (! NT_SUCCESS(Status))
{
- Info.Ansi = ! Window->Wnd->Unicode;
+ Info.Ansi = ! Window->Unicode;
}
- Info.Ansi = !Window->Wnd->Unicode;
- Info.Proc = Window->Wnd->lpfnWndProc;
+ Info.Ansi = !Window->Unicode;
+ Info.Proc = Window->lpfnWndProc;
}
else
{
if (hWnd == HWND_BROADCAST) //Handle Broadcast
{
HWND *List;
- PWINDOW_OBJECT DesktopWindow;
+ PWND DesktopWindow;
ULONG i;
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
{
ULONG_PTR PResult;
PTHREADINFO pti;
- PWINDOW_OBJECT Window;
+ PWND Window;
if ( !(Window = UserGetWindowObject(hWnd)) ) return FALSE;
pti = PsGetCurrentThreadWin32Thread();
- if (Window->pti->MessageQueue != pti->MessageQueue)
+ if (Window->head.pti->MessageQueue != pti->MessageQueue)
{ // Send message w/o waiting for it.
Result = UserPostMessage(hWnd, Msg, wParam, lParam);
}
NTUSERGETMESSAGEINFO Info;
NTSTATUS Status;
/* FIXME: if initialization is removed, gcc complains that this may be used before initialization. Please review */
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PMSGMEMORY MsgMemoryEntry;
PVOID UserMem;
UINT Size;
NTSTATUS Status;
BOOL Present;
NTUSERGETMESSAGEINFO Info;
- PWINDOW_OBJECT Window;
+ PWND Window;
PMSGMEMORY MsgMemoryEntry;
PVOID UserMem;
UINT Size;
}
else
{
- Window = (PWINDOW_OBJECT)hWnd;
+ Window = (PWND)hWnd;
}
if (MsgFilterMax < MsgFilterMin)
LRESULT lResult = 0;
BOOL Ret = FALSE;
BOOL BadChk = FALSE;
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
IN HWND hWnd,
IN DWORD dwFlags)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
HMONITOR hMonitor = NULL;
RECTL Rect;
DECLARE_RETURN(HMONITOR);
RETURN(hMonitor);
}
- if (!Window->Wnd)
- RETURN(hMonitor);
-
- Rect.left = Rect.right = Window->Wnd->rcWindow.left;
- Rect.top = Rect.bottom = Window->Wnd->rcWindow.bottom;
+ Rect.left = Rect.right = Window->rcWindow.left;
+ Rect.top = Rect.bottom = Window->rcWindow.bottom;
IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);
IdlePing(VOID)
{
HWND hWnd;
- PWINDOW_OBJECT Window;
+ PWND Window;
PPROCESSINFO W32d = PsGetCurrentProcessWin32Process();
hWnd = UserGetForegroundWindow();
Window = UserGetWindowObject(hWnd);
- if (Window && Window->pti)
+ if (Window && Window->head.pti)
{
- if (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_FOREGROUNDIDLE))
+ if (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_FOREGROUNDIDLE))
{
co_HOOK_CallHooks(WH_FOREGROUNDIDLE,HC_ACTION,0,0);
}
}
static BOOL APIENTRY
-co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window, UINT FilterLow, UINT FilterHigh,
+co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWND Window, UINT FilterLow, UINT FilterHigh,
PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed,
- PWINDOW_OBJECT ScopeWin, PPOINT ScreenPoint, BOOL FromGlobalQueue, PLIST_ENTRY *Next)
+ PWND ScopeWin, PPOINT ScreenPoint, BOOL FromGlobalQueue, PLIST_ENTRY *Next)
{
USHORT Msg = Message->Msg.message;
- PWINDOW_OBJECT CaptureWindow = NULL;
+ PWND CaptureWindow = NULL;
HWND hCaptureWin;
/* FIXME: Mouse message can be sent before the Desktop is up and running in which case ScopeWin (Desktop) is 0.
return(FALSE);
}
- if (CaptureWindow->pti->MessageQueue != MessageQueue)
+ if (CaptureWindow->head.pti->MessageQueue != MessageQueue)
{
if (! FromGlobalQueue)
{
/* lock the destination message queue, so we don't get in trouble with other
threads, messing with it at the same time */
- IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
- InsertTailList(&CaptureWindow->pti->MessageQueue->HardwareMessagesListHead,
+ IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
+ InsertTailList(&CaptureWindow->head.pti->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
if(Message->Msg.message == WM_MOUSEMOVE)
{
- if(CaptureWindow->pti->MessageQueue->MouseMoveMsg)
+ if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg)
{
/* remove the old WM_MOUSEMOVE message, we're processing a more recent
one */
- RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
- ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
+ RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
+ ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
}
/* save the pointer to the WM_MOUSEMOVE message in the new queue */
- CaptureWindow->pti->MessageQueue->MouseMoveMsg = Message;
+ CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = Message;
- CaptureWindow->pti->MessageQueue->QueueBits |= QS_MOUSEMOVE;
- CaptureWindow->pti->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
- if (CaptureWindow->pti->MessageQueue->WakeMask & QS_MOUSEMOVE)
- KeSetEvent(CaptureWindow->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ CaptureWindow->head.pti->MessageQueue->QueueBits |= QS_MOUSEMOVE;
+ CaptureWindow->head.pti->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
+ if (CaptureWindow->head.pti->MessageQueue->WakeMask & QS_MOUSEMOVE)
+ KeSetEvent(CaptureWindow->head.pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
}
else
{
- CaptureWindow->pti->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
- CaptureWindow->pti->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
- if (CaptureWindow->pti->MessageQueue->WakeMask & QS_MOUSEBUTTON)
- KeSetEvent(CaptureWindow->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+ CaptureWindow->head.pti->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
+ CaptureWindow->head.pti->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
+ if (CaptureWindow->head.pti->MessageQueue->WakeMask & QS_MOUSEBUTTON)
+ KeSetEvent(CaptureWindow->head.pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
}
- IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+ IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
*Freed = FALSE;
UserDereferenceObject(CaptureWindow);
*ScreenPoint = Message->Msg.pt;
- if((Window != NULL && PtrToInt(Window) != 1 && CaptureWindow->hSelf != Window->hSelf) ||
+ if((Window != NULL && PtrToInt(Window) != 1 && CaptureWindow->head.h != Window->head.h) ||
((FilterLow != 0 || FilterHigh != 0) && (Msg < FilterLow || Msg > FilterHigh)))
{
/* Reject the message because it doesn't match the filter */
/* Lock the message queue so no other thread can mess with it.
Our own message queue is not locked while fetching from the global
queue, so we have to make sure nothing interferes! */
- IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+ IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
/* if we're from the global queue, we need to add our message to our
private queue so we don't loose it! */
- InsertTailList(&CaptureWindow->pti->MessageQueue->HardwareMessagesListHead,
+ InsertTailList(&CaptureWindow->head.pti->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
}
if (Message->Msg.message == WM_MOUSEMOVE)
{
- if(CaptureWindow->pti->MessageQueue->MouseMoveMsg &&
- (CaptureWindow->pti->MessageQueue->MouseMoveMsg != Message))
+ if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg &&
+ (CaptureWindow->head.pti->MessageQueue->MouseMoveMsg != Message))
{
/* delete the old message */
- RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
- ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
+ RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
+ ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
if (!FromGlobalQueue)
{
// We might have deleted the next one in our queue, so fix next
}
/* always save a pointer to this WM_MOUSEMOVE message here because we're
sure that the message is in the private queue */
- CaptureWindow->pti->MessageQueue->MouseMoveMsg = Message;
+ CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = Message;
}
if(FromGlobalQueue)
{
- IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+ IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
}
UserDereferenceObject(CaptureWindow);
}
/* FIXME - only assign if removing? */
- Message->Msg.hwnd = CaptureWindow->hSelf;
+ Message->Msg.hwnd = CaptureWindow->head.h;
Message->Msg.message = Msg;
Message->Msg.lParam = MAKELONG(Message->Msg.pt.x, Message->Msg.pt.y);
/* Lock the message queue so no other thread can mess with it.
Our own message queue is not locked while fetching from the global
queue, so we have to make sure nothing interferes! */
- IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
- if(CaptureWindow->pti->MessageQueue->MouseMoveMsg)
+ IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
+ if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg)
{
/* delete the WM_(NC)MOUSEMOVE message in the private queue, we're dealing
with one that's been sent later */
- RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
- ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
+ RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
+ ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
/* our message is not in the private queue so we can remove the pointer
instead of setting it to the current message we're processing */
- CaptureWindow->pti->MessageQueue->MouseMoveMsg = NULL;
+ CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = NULL;
}
- IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+ IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
}
- else if (CaptureWindow->pti->MessageQueue->MouseMoveMsg == Message)
+ else if (CaptureWindow->head.pti->MessageQueue->MouseMoveMsg == Message)
{
- CaptureWindow->pti->MessageQueue->MouseMoveMsg = NULL;
+ CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = NULL;
}
}
}
BOOL APIENTRY
-co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window,
+co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWND Window,
UINT FilterLow, UINT FilterHigh, BOOL Remove,
PUSER_MESSAGE* Message)
{
POINT ScreenPoint;
BOOL Accept, Freed;
PLIST_ENTRY CurrentEntry;
- PWINDOW_OBJECT DesktopWindow = NULL;
+ PWND DesktopWindow = NULL;
PVOID WaitObjects[2];
NTSTATUS WaitStatus;
DECLARE_RETURN(BOOL);
if (DesktopWindow)
{
UserRefObjectCo(DesktopWindow, &Ref);//can DesktopWindow be NULL?
- Desk = DesktopWindow->pti->pDeskInfo;
+ Desk = DesktopWindow->head.pti->pDeskInfo;
}
/* Process messages in the message queue itself. */
VOID FASTCALL
MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PTHREADINFO Win32Thread;
MSG Mesg;
LARGE_INTEGER LargeTickCount;
KeQueryTickCount(&LargeTickCount);
Mesg.time = MsqCalculateMessageTime(&LargeTickCount);
Mesg.pt = gpsi->ptCursor;
- MsqPostMessage(Window->pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
+ MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
UserDereferenceObject(Window);
ObDereferenceObject (Thread);
PUSER_MESSAGE PostedMessage;
PUSER_MESSAGE_QUEUE MessageQueue;
PLIST_ENTRY CurrentEntry, ListHead;
- PWINDOW_OBJECT Window = pWindow;
+ PWND Window = pWindow;
ASSERT(Window);
- MessageQueue = Window->pti->MessageQueue;
+ MessageQueue = Window->head.pti->MessageQueue;
ASSERT(MessageQueue);
/* remove the posted messages for this window */
{
PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
ListEntry);
- if (PostedMessage->Msg.hwnd == Window->hSelf)
+ if (PostedMessage->Msg.hwnd == Window->head.h)
{
RemoveEntryList(&PostedMessage->ListEntry);
MsqDestroyMessage(PostedMessage);
{
SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE,
ListEntry);
- if(SentMessage->Msg.hwnd == Window->hSelf)
+ if(SentMessage->Msg.hwnd == Window->head.h)
{
DPRINT("Notify the sender and remove a message from the queue that had not been dispatched\n");
co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
- IN PWINDOW_OBJECT Window,
+ IN PWND Window,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message)
ListEntry);
if ( ( !Window ||
PtrToInt(Window) == 1 ||
- Window->hSelf == CurrentMessage->Msg.hwnd ) &&
+ Window->head.h == CurrentMessage->Msg.hwnd ) &&
( (MsgFilterLow == 0 && MsgFilterHigh == 0) ||
( MsgFilterLow <= CurrentMessage->Msg.message &&
MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
}
NTSTATUS FASTCALL
-co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
+co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
UINT MsgFilterMin, UINT MsgFilterMax)
{
PVOID WaitObjects[2] = {MessageQueue->NewMessages, &HardwareMessageEvent};
switch (type)
{
-// case otWindow:
+ case otWindow:
// case otMenu:
// case otHook:
// case otCallProc:
switch (type)
{
-// case otWindow:
+ case otWindow:
// case otMenu:
// case otHook:
// case otCallProc:
*/
BOOL FASTCALL
-IntIntersectWithParents(PWINDOW_OBJECT Child, RECTL *WindowRect)
+IntIntersectWithParents(PWND Child, RECTL *WindowRect)
{
- PWINDOW_OBJECT ParentWindow;
PWND ParentWnd;
- ParentWindow = Child->spwndParent;
- while (ParentWindow != NULL)
+ ParentWnd = Child->spwndParent;
+ while (ParentWnd != NULL)
{
- ParentWnd = ParentWindow->Wnd;
if (!(ParentWnd->style & WS_VISIBLE) ||
(ParentWnd->style & WS_MINIMIZE))
{
/* FIXME: Layered windows. */
- ParentWindow = ParentWindow->spwndParent;
+ ParentWnd = ParentWnd->spwndParent;
}
return TRUE;
}
BOOL FASTCALL
-IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
+IntValidateParent(PWND Child, HRGN hValidateRgn, BOOL Recurse)
{
- PWINDOW_OBJECT ParentWindow = Child->spwndParent;
- PWND ParentWnd;
+ PWND ParentWnd = Child->spwndParent;
- while (ParentWindow)
+ while (ParentWnd)
{
- ParentWnd = ParentWindow->Wnd;
if (ParentWnd->style & WS_CLIPCHILDREN)
break;
- if (ParentWindow->hrgnUpdate != 0)
+ if (ParentWnd->hrgnUpdate != 0)
{
if (Recurse)
return FALSE;
- IntInvalidateWindows( ParentWindow,
+ IntInvalidateWindows( ParentWnd,
hValidateRgn,
RDW_VALIDATE | RDW_NOCHILDREN);
}
- ParentWindow = ParentWindow->spwndParent;
+ ParentWnd = ParentWnd->spwndParent;
}
return TRUE;
*/
HRGN FASTCALL
-IntCalcWindowRgn(PWINDOW_OBJECT Window, BOOL Client)
+IntCalcWindowRgn(PWND Wnd, BOOL Client)
{
- PWND Wnd;
HRGN hRgnWindow;
- Wnd = Window->Wnd;
if (Client)
hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
else
hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
- if (Window->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
+ if (Wnd->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(hRgnWindow,
-Wnd->rcWindow.left,
-Wnd->rcWindow.top);
- NtGdiCombineRgn(hRgnWindow, hRgnWindow, Window->hrgnClip, RGN_AND);
+ NtGdiCombineRgn(hRgnWindow, hRgnWindow, Wnd->hrgnClip, RGN_AND);
NtGdiOffsetRgn(hRgnWindow,
Wnd->rcWindow.left,
Wnd->rcWindow.top);
*/
HRGN FASTCALL
-IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
+IntGetNCUpdateRgn(PWND Window, BOOL Validate)
{
HRGN hRgnNonClient;
HRGN hRgnWindow;
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
REGION_FreeRgnByHandle(Window->hrgnUpdate);
Window->hrgnUpdate = NULL;
- if (!(Window->Wnd->state & WNDS_INTERNALPAINT))
- MsqDecPaintCountQueue(Window->pti->MessageQueue);
+ if (!(Window->state & WNDS_INTERNALPAINT))
+ MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
}
}
*/
VOID FASTCALL
-co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
+co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
{
HDC hDC;
- HWND hWnd = Window->hSelf;
+ HWND hWnd = Wnd->head.h;
HRGN TempRegion;
- PWND Wnd;
-
- Wnd = Window->Wnd;
if (Flags & (RDW_ERASENOW | RDW_UPDATENOW))
{
- if (Window->hrgnUpdate)
+ if (Wnd->hrgnUpdate)
{
- if (!IntValidateParent(Window, Window->hrgnUpdate, Recurse))
+ if (!IntValidateParent(Wnd, Wnd->hrgnUpdate, Recurse))
return;
}
if (Flags & RDW_UPDATENOW)
{
- if (Window->hrgnUpdate != NULL ||
+ if (Wnd->hrgnUpdate != NULL ||
Wnd->state & WNDS_INTERNALPAINT)
{
co_IntSendMessage(hWnd, WM_PAINT, 0, 0);
}
else
{
- if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
+ if (Wnd->state & WNDS_SENDNCPAINT)
{
- TempRegion = IntGetNCUpdateRgn(Window, TRUE);
- Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
- MsqDecPaintCountQueue(Window->pti->MessageQueue);
+ TempRegion = IntGetNCUpdateRgn(Wnd, TRUE);
+ Wnd->state &= ~WNDS_SENDNCPAINT;
+ MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0);
if ( (HANDLE) 1 != TempRegion &&
}
}
- if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
+ if (Wnd->state & WNDS_ERASEBACKGROUND)
{
- if (Window->hrgnUpdate)
+ if (Wnd->hrgnUpdate)
{
- hDC = UserGetDCEx( Window,
- Window->hrgnUpdate,
+ hDC = UserGetDCEx( Wnd,
+ Wnd->hrgnUpdate,
DCX_CACHE|DCX_USESTYLE|DCX_INTERSECTRGN|DCX_KEEPCLIPRGN);
if (co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0))
{
- Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ Wnd->state &= ~WNDS_ERASEBACKGROUND;
}
- UserReleaseDC(Window, hDC, FALSE);
+ UserReleaseDC(Wnd, hDC, FALSE);
}
}
}
{
HWND *List, *phWnd;
- if ((List = IntWinListChildren(Window)))
+ if ((List = IntWinListChildren(Wnd)))
{
/* FIXME: Handle WS_EX_TRANSPARENT */
for (phWnd = List; *phWnd; ++phWnd)
{
- Window = UserGetWindowObject(*phWnd);
- Wnd = Window->Wnd;
- if (Window && (Wnd->style & WS_VISIBLE))
+ Wnd = UserGetWindowObject(*phWnd);
+ if (Wnd && (Wnd->style & WS_VISIBLE))
{
USER_REFERENCE_ENTRY Ref;
- UserRefObjectCo(Window, &Ref);
- co_IntPaintWindows(Window, Flags, TRUE);
- UserDerefObjectCo(Window);
+ UserRefObjectCo(Wnd, &Ref);
+ co_IntPaintWindows(Wnd, Flags, TRUE);
+ UserDerefObjectCo(Wnd);
}
}
ExFreePool(List);
*/
VOID FASTCALL
-IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
+IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags)
{
INT RgnType;
- PWND Wnd;
BOOL HadPaintMessage, HadNCPaintMessage;
BOOL HasPaintMessage, HasNCPaintMessage;
- Wnd = Window->Wnd;
DPRINT("IntInvalidateWindows start\n");
/*
* If the nonclient is not to be redrawn, clip the region to the client
{
HRGN hRgnClient;
- hRgnClient = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ hRgnClient = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND);
REGION_FreeRgnByHandle(hRgnClient);
}
* Clip the given region with window rectangle (or region)
*/
- if (!Window->hrgnClip || (Wnd->style & WS_MINIMIZE))
+ if (!Wnd->hrgnClip || (Wnd->style & WS_MINIMIZE))
{
HRGN hRgnWindow;
- hRgnWindow = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND);
REGION_FreeRgnByHandle(hRgnWindow);
}
NtGdiOffsetRgn( hRgn,
-Wnd->rcWindow.left,
-Wnd->rcWindow.top);
- RgnType = NtGdiCombineRgn(hRgn, hRgn, Window->hrgnClip, RGN_AND);
+ RgnType = NtGdiCombineRgn(hRgn, hRgn, Wnd->hrgnClip, RGN_AND);
NtGdiOffsetRgn( hRgn,
Wnd->rcWindow.left,
Wnd->rcWindow.top);
* Save current state of pending updates
*/
- HadPaintMessage = Window->hrgnUpdate != NULL ||
+ HadPaintMessage = Wnd->hrgnUpdate != NULL ||
Wnd->state & WNDS_INTERNALPAINT;
- HadNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
+ HadNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT;
/*
* Update the region and flags
if (Flags & RDW_INVALIDATE && RgnType != NULLREGION)
{
- if (Window->hrgnUpdate == NULL)
+ if (Wnd->hrgnUpdate == NULL)
{
- Window->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0);
- IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
+ Wnd->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0);
+ IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
}
- if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
+ if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate,
hRgn, RGN_OR) == NULLREGION)
{
- IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
- REGION_FreeRgnByHandle(Window->hrgnUpdate);
- Window->hrgnUpdate = NULL;
+ IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
+ REGION_FreeRgnByHandle(Wnd->hrgnUpdate);
+ Wnd->hrgnUpdate = NULL;
}
if (Flags & RDW_FRAME)
- Window->state |= WINDOWOBJECT_NEED_NCPAINT;
+ Wnd->state |= WNDS_SENDNCPAINT;
if (Flags & RDW_ERASE)
- Window->state |= WINDOWOBJECT_NEED_ERASEBKGND;
+ Wnd->state |= WNDS_ERASEBACKGROUND;
Flags |= RDW_FRAME;
}
if (Flags & RDW_VALIDATE && RgnType != NULLREGION)
{
- if (Window->hrgnUpdate != NULL)
+ if (Wnd->hrgnUpdate != NULL)
{
- if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
+ if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate,
hRgn, RGN_DIFF) == NULLREGION)
{
- IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
- REGION_FreeRgnByHandle(Window->hrgnUpdate);
- Window->hrgnUpdate = NULL;
+ IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
+ REGION_FreeRgnByHandle(Wnd->hrgnUpdate);
+ Wnd->hrgnUpdate = NULL;
}
}
- if (Window->hrgnUpdate == NULL)
- Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ if (Wnd->hrgnUpdate == NULL)
+ Wnd->state &= ~WNDS_ERASEBACKGROUND;
if (Flags & RDW_NOFRAME)
- Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
+ Wnd->state &= ~WNDS_SENDNCPAINT;
if (Flags & RDW_NOERASE)
- Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ Wnd->state &= ~WNDS_ERASEBACKGROUND;
}
if (Flags & RDW_INTERNALPAINT)
if (!(Flags & RDW_NOCHILDREN) && !(Wnd->style & WS_MINIMIZE) &&
((Flags & RDW_ALLCHILDREN) || !(Wnd->style & WS_CLIPCHILDREN)))
{
- PWINDOW_OBJECT Child;
+ PWND Child;
- for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
+ for (Child = Wnd->spwndChild; Child; Child = Child->spwndNext)
{
- if (Child->Wnd->style & WS_VISIBLE)
+ if (Child->style & WS_VISIBLE)
{
/*
* Recursive call to update children hrgnUpdate
* Fake post paint messages to window message queue if needed
*/
- HasPaintMessage = Window->hrgnUpdate != NULL ||
+ HasPaintMessage = Wnd->hrgnUpdate != NULL ||
Wnd->state & WNDS_INTERNALPAINT;
- HasNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
+ HasNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT;
if (HasPaintMessage != HadPaintMessage)
{
if (HadPaintMessage)
- MsqDecPaintCountQueue(Window->pti->MessageQueue);
+ MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
else
- MsqIncPaintCountQueue(Window->pti->MessageQueue);
+ MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue);
}
if (HasNCPaintMessage != HadNCPaintMessage)
{
if (HadNCPaintMessage)
- MsqDecPaintCountQueue(Window->pti->MessageQueue);
+ MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
else
- MsqIncPaintCountQueue(Window->pti->MessageQueue);
+ MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue);
}
DPRINT("IntInvalidateWindows exit\n");
}
*/
BOOL FASTCALL
-IntIsWindowDrawable(PWINDOW_OBJECT Window)
+IntIsWindowDrawable(PWND Wnd)
{
- PWINDOW_OBJECT WndObject;
- PWND Wnd;
+ PWND WndObject;
- for (WndObject = Window; WndObject != NULL; WndObject = WndObject->spwndParent)
+ for (WndObject = Wnd; WndObject != NULL; WndObject = WndObject->spwndParent)
{
- Wnd = WndObject->Wnd;
- if ( Window->state & WINDOWSTATUS_DESTROYING || // state2
- Window->state & WINDOWSTATUS_DESTROYED ||
- !Wnd ||
- !(Wnd->style & WS_VISIBLE) ||
- ((Wnd->style & WS_MINIMIZE) && (WndObject != Window)))
+ if ( WndObject->state2 & WNDS2_INDESTROY ||
+ WndObject->state & WNDS_DESTROYED ||
+ !WndObject ||
+ !(WndObject->style & WS_VISIBLE) ||
+ ((WndObject->style & WS_MINIMIZE) && (WndObject != Wnd)))
{
return FALSE;
}
/*
* IntRedrawWindow
*
- * Internal version of NtUserRedrawWindow that takes WINDOW_OBJECT as
+ * Internal version of NtUserRedrawWindow that takes WND as
* first parameter.
*/
BOOL FASTCALL
co_UserRedrawWindow(
- PWINDOW_OBJECT Window,
+ PWND Window,
const RECTL* UpdateRect,
HRGN UpdateRgn,
ULONG Flags)
hRgn = NULL;
}
else
- NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
+ NtGdiOffsetRgn(hRgn, Window->rcClient.left, Window->rcClient.top);
}
else if (UpdateRect != NULL)
{
if (!RECTL_bIsEmptyRect(UpdateRect))
{
hRgn = IntSysCreateRectRgnIndirect((RECTL *)UpdateRect);
- NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
+ NtGdiOffsetRgn(hRgn, Window->rcClient.left, Window->rcClient.top);
}
}
else if ((Flags & (RDW_INVALIDATE | RDW_FRAME)) == (RDW_INVALIDATE | RDW_FRAME) ||
(Flags & (RDW_VALIDATE | RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME))
{
- if (!RECTL_bIsEmptyRect(&Window->Wnd->rcWindow))
- hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ if (!RECTL_bIsEmptyRect(&Window->rcWindow))
+ hRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
}
else
{
- if (!RECTL_bIsEmptyRect(&Window->Wnd->rcClient))
- hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ if (!RECTL_bIsEmptyRect(&Window->rcClient))
+ hRgn = IntSysCreateRectRgnIndirect(&Window->rcClient);
}
}
}
BOOL FASTCALL
-IntIsWindowDirty(PWINDOW_OBJECT Window)
+IntIsWindowDirty(PWND Wnd)
{
- PWND Wnd = Window->Wnd;
return (Wnd->style & WS_VISIBLE) &&
- ((Window->hrgnUpdate != NULL) ||
+ ((Wnd->hrgnUpdate != NULL) ||
(Wnd->state & WNDS_INTERNALPAINT) ||
- (Window->state & WINDOWOBJECT_NEED_NCPAINT));
+ (Wnd->state & WNDS_SENDNCPAINT));
}
HWND FASTCALL
-IntFindWindowToRepaint(PWINDOW_OBJECT Window, PTHREADINFO Thread)
+IntFindWindowToRepaint(PWND Window, PTHREADINFO Thread)
{
HWND hChild;
- PWINDOW_OBJECT TempWindow;
- PWND Wnd, TempWnd;
+ PWND TempWindow;
for (; Window != NULL; Window = Window->spwndNext)
{
- Wnd = Window->Wnd;
if (IntWndBelongsToThread(Window, Thread) &&
IntIsWindowDirty(Window))
{
/* Make sure all non-transparent siblings are already drawn. */
- if (Wnd->ExStyle & WS_EX_TRANSPARENT)
+ if (Window->ExStyle & WS_EX_TRANSPARENT)
{
for (TempWindow = Window->spwndNext; TempWindow != NULL;
TempWindow = TempWindow->spwndNext)
{
- TempWnd = TempWindow->Wnd;
- if (!(TempWnd->ExStyle & WS_EX_TRANSPARENT) &&
+ if (!(TempWindow->ExStyle & WS_EX_TRANSPARENT) &&
IntWndBelongsToThread(TempWindow, Thread) &&
IntIsWindowDirty(TempWindow))
{
- return TempWindow->hSelf;
+ return TempWindow->head.h;
}
}
}
- return Window->hSelf;
+ return Window->head.h;
}
if (Window->spwndChild)
BOOL FASTCALL
IntGetPaintMessage(
- PWINDOW_OBJECT Window,
+ PWND Window,
UINT MsgFilterMin,
UINT MsgFilterMax,
PTHREADINFO Thread,
return FALSE;
}
- if (Window != NULL && Message->hwnd != Window->hSelf)
+ if (Window != NULL && Message->hwnd != Window->head.h)
return FALSE;
Message->message = WM_PAINT;
static
HWND FASTCALL
-co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
+co_IntFixCaret(PWND Window, RECTL *lprc, UINT flags)
{
PDESKTOP Desktop;
PTHRDCARETINFO CaretInfo;
HWND hWndCaret;
- PWINDOW_OBJECT WndCaret;
+ PWND WndCaret;
ASSERT_REFS_CO(Window);
BOOL
FASTCALL
IntPrintWindow(
- PWINDOW_OBJECT Window,
+ PWND pwnd,
HDC hdcBlt,
UINT nFlags)
{
- PWND pwnd;
HDC hdcSrc;
INT cx, cy, xSrc, ySrc;
- pwnd = Window->Wnd;
-
- if (!pwnd)
- return FALSE;
-
if ( nFlags & PW_CLIENTONLY)
{
cx = pwnd->rcClient.right - pwnd->rcClient.left;
return FALSE;
/* Update the window just incase. */
- co_IntPaintWindows( Window, RDW_ERASENOW|RDW_UPDATENOW, FALSE);
+ co_IntPaintWindows( pwnd, RDW_ERASENOW|RDW_UPDATENOW, FALSE);
- hdcSrc = UserGetDCEx( Window, NULL, DCX_CACHE|DCX_WINDOW);
+ hdcSrc = UserGetDCEx( pwnd, NULL, DCX_CACHE|DCX_WINDOW);
/* Print window to printer context. */
NtGdiBitBlt( hdcBlt,
0,
0,
0);
- UserReleaseDC( Window, hdcSrc, FALSE);
+ UserReleaseDC( pwnd, hdcSrc, FALSE);
// TODO: Release Redirection from Print.
HDC APIENTRY
NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PAINTSTRUCT Ps;
NTSTATUS Status;
DECLARE_RETURN(HDC);
USER_REFERENCE_ENTRY Ref;
- PWND Wnd;
DPRINT("Enter NtUserBeginPaint\n");
UserEnterExclusive();
UserRefObjectCo(Window, &Ref);
- Wnd = Window->Wnd;
-
co_UserHideCaret(Window);
- if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
+ if (Window->state & WNDS_SENDNCPAINT)
{
HRGN hRgn;
hRgn = IntGetNCUpdateRgn(Window, FALSE);
- Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
- MsqDecPaintCountQueue(Window->pti->MessageQueue);
+ Window->state &= ~WNDS_SENDNCPAINT;
+ MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)hRgn, 0);
if (hRgn != (HANDLE)1 && hRgn != NULL)
{
if (Window->hrgnUpdate != NULL)
{
- MsqDecPaintCountQueue(Window->pti->MessageQueue);
+ MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
GdiGetClipBox(Ps.hdc, &Ps.rcPaint);
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
/* The region is part of the dc now and belongs to the process! */
}
else
{
- if (Wnd->state & WNDS_INTERNALPAINT)
- MsqDecPaintCountQueue(Window->pti->MessageQueue);
+ if (Window->state & WNDS_INTERNALPAINT)
+ MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
IntGetClientRect(Window, &Ps.rcPaint);
}
- Wnd->state &= ~WNDS_INTERNALPAINT;
+ Window->state &= ~WNDS_INTERNALPAINT;
- if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
+ if (Window->state & WNDS_ERASEBACKGROUND)
{
- Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+ Window->state &= ~WNDS_ERASEBACKGROUND;
Ps.fErase = !co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)Ps.hdc, 0);
}
else
}
if (Window->hrgnUpdate)
{
- if (!(Wnd->style & WS_CLIPCHILDREN))
+ if (!(Window->style & WS_CLIPCHILDREN))
{
- PWINDOW_OBJECT Child;
+ PWND Child;
for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
{
IntInvalidateWindows(Child, Window->hrgnUpdate, RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* pUnsafePs)
{
NTSTATUS Status = STATUS_SUCCESS;
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
HDC hdc = NULL;
INT FASTCALL
-co_UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase)
+co_UserGetUpdateRgn(PWND Window, HRGN hRgn, BOOL bErase)
{
int RegionType;
RECTL Rect;
}
else
{
- Rect = Window->Wnd->rcClient;
+ Rect = Window->rcClient;
IntIntersectWithParents(Window, &Rect);
NtGdiSetRectRgn(hRgn, Rect.left, Rect.top, Rect.right, Rect.bottom);
RegionType = NtGdiCombineRgn(hRgn, hRgn, Window->hrgnUpdate, RGN_AND);
- NtGdiOffsetRgn(hRgn, -Window->Wnd->rcClient.left, -Window->Wnd->rcClient.top);
+ NtGdiOffsetRgn(hRgn, -Window->rcClient.left, -Window->rcClient.top);
}
if (bErase && RegionType != NULLREGION && RegionType != ERROR)
NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
{
DECLARE_RETURN(INT);
- PWINDOW_OBJECT Window;
+ PWND Window;
INT ret;
USER_REFERENCE_ENTRY Ref;
BOOL APIENTRY
NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
RECTL Rect;
INT RegionType;
PROSRGNDATA RgnData;
/* Get the update region bounding box. */
if (Window->hrgnUpdate == (HRGN)1)
{
- Rect = Window->Wnd->rcClient;
+ Rect = Window->rcClient;
}
else
{
RGNOBJAPI_Unlock(RgnData);
if (RegionType != ERROR && RegionType != NULLREGION)
- RECTL_bIntersectRect(&Rect, &Rect, &Window->Wnd->rcClient);
+ RECTL_bIntersectRect(&Rect, &Rect, &Window->rcClient);
}
if (IntIntersectWithParents(Window, &Rect))
{
RECTL_vOffsetRect(&Rect,
- -Window->Wnd->rcClient.left,
- -Window->Wnd->rcClient.top);
+ -Window->rcClient.left,
+ -Window->rcClient.top);
} else
{
Rect.left = Rect.top = Rect.right = Rect.bottom = 0;
UINT flags)
{
RECTL SafeUpdateRect;
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
BOOL Ret;
USER_REFERENCE_ENTRY Ref;
NTSTATUS Status = STATUS_SUCCESS;
{
RECTL rcScroll, rcClip, rcCaret, rcUpdate;
INT Result;
- PWINDOW_OBJECT Window = NULL, CaretWnd;
+ PWND Window = NULL, CaretWnd;
HDC hDC;
HRGN hrgnOwn = NULL, hrgnTemp;
HWND hwndCaret;
if (flags & SW_SCROLLCHILDREN)
{
- PWINDOW_OBJECT Child;
+ PWND Child;
RECTL rcChild;
POINT ClientOrigin;
USER_REFERENCE_ENTRY WndRef;
IntGetClientOrigin(Window, &ClientOrigin);
for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
{
- rcChild = Child->Wnd->rcWindow;
+ rcChild = Child->rcWindow;
rcChild.left -= ClientOrigin.x;
rcChild.top -= ClientOrigin.y;
rcChild.right -= ClientOrigin.x;
BOOL
UserDrawSysMenuButton(
- PWINDOW_OBJECT pWnd,
+ PWND pWnd,
HDC hDc,
RECTL *lpRc,
BOOL Down)
/* Get the icon to draw. We don't care about WM_GETICON here. */
- hIcon = pWnd->Wnd->pcls->hIconSm;
+ hIcon = pWnd->pcls->hIconSm;
if(!hIcon)
{
DPRINT("Wnd class has no small icon.\n");
- hIcon = pWnd->Wnd->pcls->hIcon;
+ hIcon = pWnd->pcls->hIcon;
}
if(!hIcon)
}
BOOL UserDrawCaption(
- PWINDOW_OBJECT pWnd,
+ PWND pWnd,
HDC hDc,
RECTL *lpRc,
HFONT hFont,
RECTL r = *lpRc;
LONG ButtonWidth, IconWidth;
BOOL HasIcon;
- PWND Wnd = NULL;
//ASSERT(pWnd != NULL);
- if (pWnd)
- Wnd = pWnd->Wnd;
-
RECTL_vMakeWellOrdered(lpRc);
hMemBmp = NtGdiCreateCompatibleBitmap(hDc,
lpRc->right - lpRc->left,
VCenter = (lpRc->bottom - lpRc->top) / 2;
Padding = VCenter - (Height / 2);
- if ((!hIcon) && (Wnd != NULL))
+ if ((!hIcon) && (pWnd != NULL))
{
- HasIcon = (uFlags & DC_ICON) && (Wnd->style & WS_SYSMENU)
- && !(uFlags & DC_SMALLCAP) && !(Wnd->ExStyle & WS_EX_DLGMODALFRAME)
- && !(Wnd->ExStyle & WS_EX_TOOLWINDOW);
+ HasIcon = (uFlags & DC_ICON) && (pWnd->style & WS_SYSMENU)
+ && !(uFlags & DC_SMALLCAP) && !(pWnd->ExStyle & WS_EX_DLGMODALFRAME)
+ && !(pWnd->ExStyle & WS_EX_TOOLWINDOW);
}
else
HasIcon = (hIcon != 0);
TRIVERTEX vert[2];
COLORREF Colors[2];
- if (Wnd != NULL)
+ if (pWnd != NULL)
{
- if(Wnd->style & WS_SYSMENU)
+ if(pWnd->style & WS_SYSMENU)
{
r.right -= 3 + ButtonWidth;
if(!(uFlags & DC_SMALLCAP))
{
- if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
+ if(pWnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
r.right -= 2 + 2 * ButtonWidth;
else r.right -= 2;
r.right -= 2;
ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2;
else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2;
- if ((Wnd != NULL) && (Wnd->style & WS_SYSMENU))
+ if ((pWnd != NULL) && (pWnd->style & WS_SYSMENU))
{
r.right -= 3 + ButtonWidth;
if(! (uFlags & DC_SMALLCAP))
{
- if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
+ if(pWnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
r.right -= 2 + 2 * ButtonWidth;
else r.right -= 2;
r.right -= 2;
else if (pWnd != NULL)
{
UNICODE_STRING ustr;
- ustr.Buffer = pWnd->Wnd->strName.Buffer;
- ustr.Length = pWnd->Wnd->strName.Length;
- ustr.MaximumLength = pWnd->Wnd->strName.MaximumLength;
+ ustr.Buffer = pWnd->strName.Buffer;
+ ustr.Length = pWnd->strName.Length;
+ ustr.MaximumLength = pWnd->strName.MaximumLength;
UserDrawCaptionText(hMemDc, &ustr, &r, uFlags);
}
}
const PUNICODE_STRING str,
UINT uFlags)
{
- PWINDOW_OBJECT pWnd = NULL;
+ PWND pWnd = NULL;
UNICODE_STRING SafeStr = {0};
NTSTATUS Status = STATUS_SUCCESS;
RECTL SafeRect;
HDC hdcBlt,
UINT nFlags)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL Ret = FALSE;
UserEnterExclusive();
/* STATIC FUNCTIONS **********************************************************/
PPROPERTY FASTCALL
-IntGetProp(PWINDOW_OBJECT Window, ATOM Atom)
+IntGetProp(PWND Window, ATOM Atom)
{
PLIST_ENTRY ListEntry;
PPROPERTY Property;
- ListEntry = Window->Wnd->PropListHead.Flink;
- while (ListEntry != &Window->Wnd->PropListHead)
+ ListEntry = Window->PropListHead.Flink;
+ while (ListEntry != &Window->PropListHead)
{
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
if (Property->Atom == Atom)
}
BOOL FASTCALL
-IntRemoveProp(PWINDOW_OBJECT Window, ATOM Atom)
+IntRemoveProp(PWND Window, ATOM Atom)
{
PPROPERTY Prop;
Prop = IntGetProp(Window, Atom);
}
RemoveEntryList(&Prop->PropListEntry);
UserHeapFree(Prop);
- Window->Wnd->PropListItems--;
+ Window->PropListItems--;
return TRUE;
}
BOOL FASTCALL
-IntSetProp(PWINDOW_OBJECT pWnd, ATOM Atom, HANDLE Data)
+IntSetProp(PWND pWnd, ATOM Atom, HANDLE Data)
{
PPROPERTY Prop;
return FALSE;
}
Prop->Atom = Atom;
- InsertTailList(&pWnd->Wnd->PropListHead, &Prop->PropListEntry);
- pWnd->Wnd->PropListItems++;
+ InsertTailList(&pWnd->PropListHead, &Prop->PropListEntry);
+ pWnd->PropListItems++;
}
Prop->Data = Data;
DWORD BufferSize,
DWORD *Count)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PPROPERTY Property;
PLIST_ENTRY ListEntry;
PROPLISTITEM listitem, *li;
/* copy list */
li = (PROPLISTITEM *)Buffer;
- ListEntry = Window->Wnd->PropListHead.Flink;
- while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->Wnd->PropListHead))
+ ListEntry = Window->PropListHead.Flink;
+ while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->PropListHead))
{
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
listitem.Atom = Property->Atom;
}
else
{
- Cnt = Window->Wnd->PropListItems * sizeof(PROPLISTITEM);
+ Cnt = Window->PropListItems * sizeof(PROPLISTITEM);
}
if(Count)
HANDLE APIENTRY
NtUserRemoveProp(HWND hWnd, ATOM Atom)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PPROPERTY Prop;
HANDLE Data;
DECLARE_RETURN(HANDLE);
Data = Prop->Data;
RemoveEntryList(&Prop->PropListEntry);
UserHeapFree(Prop);
- Window->Wnd->PropListItems--;
+ Window->PropListItems--;
RETURN(Data);
BOOL APIENTRY
NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetProp\n");
* the top. Return TRUE if the scrollbar is vertical, FALSE if horizontal.
*/
BOOL FASTCALL
-IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
+IntGetScrollBarRect (PWND Wnd, INT nBar, RECTL *lprect)
{
BOOL vertical;
- PWND Wnd = Window->Wnd;
- RECTL ClientRect = Window->Wnd->rcClient;
- RECTL WindowRect = Window->Wnd->rcWindow;
+ RECTL ClientRect = Wnd->rcClient;
+ RECTL WindowRect = Wnd->rcWindow;
switch (nBar)
{
break;
case SB_CTL:
- IntGetClientRect (Window, lprect);
+ IntGetClientRect (Wnd, lprect);
vertical = ((Wnd->style & SBS_VERT) != 0);
break;
}
BOOL FASTCALL
-IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPSCROLLINFO psi)
+IntCalculateThumb(PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, LPSCROLLINFO psi)
{
- PWND Wnd = Window->Wnd;
INT Thumb, ThumbBox, ThumbPos, cxy, mx;
RECTL ClientRect;
cxy = psbi->rcScrollBar.bottom - psbi->rcScrollBar.top;
break;
case SB_CTL:
- IntGetClientRect(Window, &ClientRect);
+ IntGetClientRect(Wnd, &ClientRect);
if(Wnd->style & SBS_VERT)
{
Thumb = UserGetSystemMetrics(SM_CYVSCROLL);
}
static VOID FASTCALL
-IntUpdateSBInfo(PWINDOW_OBJECT Window, int wBar)
+IntUpdateSBInfo(PWND Window, int wBar)
{
PSCROLLBARINFO sbi;
LPSCROLLINFO psi;
ASSERT(Window);
- ASSERT(Window->pSBInfo);
+ ASSERT(Window->pSBInfoex);
sbi = IntGetScrollbarInfoFromWindow(Window, wBar);
psi = IntGetScrollInfoFromWindow(Window, wBar);
}
static BOOL FASTCALL
-co_IntGetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPSCROLLINFO lpsi)
+co_IntGetScrollInfo(PWND Window, INT nBar, LPSCROLLINFO lpsi)
{
UINT Mask;
LPSCROLLINFO psi;
}
static DWORD FASTCALL
-co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
+co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
{
/*
* Update the scrollbar state and set action flags according to
if (bRedraw)
{
RECTL UpdateRect = psbi->rcScrollBar;
- UpdateRect.left -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
- UpdateRect.right -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
- UpdateRect.top -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
- UpdateRect.bottom -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
+ UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left;
+ UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left;
+ UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top;
+ UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top;
co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME);
}
}
BOOL FASTCALL
-co_IntGetScrollBarInfo(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi)
+co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
{
INT Bar;
PSCROLLBARINFO sbi;
}
BOOL FASTCALL
-co_IntCreateScrollBars(PWINDOW_OBJECT Window)
+co_IntCreateScrollBars(PWND Window)
{
PSCROLLBARINFO psbi;
LPSCROLLINFO psi;
ASSERT_REFS_CO(Window);
- if(Window->pSBInfo)
+ if(Window->pSBInfoex)
{
/* no need to create it anymore */
return TRUE;
/* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
Size = 3 * (sizeof(SBINFOEX));
- if(!(Window->pSBInfo = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
+ if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
{
- DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->hSelf);
+ DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->head.h);
return FALSE;
}
- RtlZeroMemory(Window->pSBInfo, Size);
+ RtlZeroMemory(Window->pSBInfoex, Size);
co_WinPosGetNonClientSize(Window,
- &Window->Wnd->rcWindow,
- &Window->Wnd->rcClient);
+ &Window->rcWindow,
+ &Window->rcClient);
for(s = SB_HORZ; s <= SB_VERT; s++)
{
}
BOOL FASTCALL
-IntDestroyScrollBars(PWINDOW_OBJECT Window)
+IntDestroyScrollBars(PWND Window)
{
- if(Window->pSBInfo)
+ if(Window->pSBInfoex)
{
- ExFreePool(Window->pSBInfo);
- Window->pSBInfo = NULL;
+ ExFreePool(Window->pSBInfoex);
+ Window->pSBInfoex = NULL;
return TRUE;
}
return FALSE;
{
NTSTATUS Status;
SCROLLBARINFO sbi;
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL Ret;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
LPSCROLLINFO lpsi)
{
NTSTATUS Status;
- PWINDOW_OBJECT Window;
+ PWND Window;
SCROLLINFO psi;
DWORD sz;
BOOL Ret;
UINT wSBflags,
UINT wArrows)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
BOOL Chg = FALSE;
DECLARE_RETURN(BOOL);
LONG idObject,
SETSCROLLBARINFO *info)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
SETSCROLLBARINFO Safeinfo;
PSCROLLBARINFO sbi;
LPSCROLLINFO psi;
LPCSCROLLINFO lpsi,
BOOL bRedraw)
{
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
NTSTATUS Status;
SCROLLINFO ScrollInfo;
DECLARE_RETURN(DWORD);
/* Ported from WINE20020904 (SCROLL_ShowScrollBar) */
DWORD FASTCALL
-co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
+co_UserShowScrollBar(PWND Wnd, int wBar, DWORD bShow)
{
DWORD Style, OldStyle;
- PWND Wnd;
- ASSERT_REFS_CO(Window);
-
- Wnd = Window->Wnd;
+ ASSERT_REFS_CO(Wnd);
switch(wBar)
{
return( FALSE);
}
- if(!co_IntCreateScrollBars(Window))
+ if(!co_IntCreateScrollBars(Wnd))
{
return( FALSE);
}
if (wBar == SB_CTL)
{
- IntUpdateSBInfo(Window, SB_CTL);
+ IntUpdateSBInfo(Wnd, SB_CTL);
- co_WinPosShowWindow(Window, bShow ? SW_SHOW : SW_HIDE);
+ co_WinPosShowWindow(Wnd, bShow ? SW_SHOW : SW_HIDE);
return( TRUE);
}
if(Wnd->style != OldStyle)
{
if(Wnd->style & WS_HSCROLL)
- IntUpdateSBInfo(Window, SB_HORZ);
+ IntUpdateSBInfo(Wnd, SB_HORZ);
if(Wnd->style & WS_VSCROLL)
- IntUpdateSBInfo(Window, SB_VERT);
+ IntUpdateSBInfo(Wnd, SB_VERT);
if(Wnd->style & WS_VISIBLE)
{
/* Frame has been changed, let the window redraw itself */
- co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
+ co_WinPosSetWindowPos(Wnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
}
}
DWORD APIENTRY
NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(DWORD);
DWORD ret;
USER_REFERENCE_ENTRY Ref;
case ONEPARAM_ROUTINE_ISWINDOWINDESTROY:
{
- PWINDOW_OBJECT Window;
+ PWND Window;
DWORD_PTR Result;
if(!(Window = UserGetWindowObject((HWND)Param)))
DWORD Routine)
{
NTSTATUS Status;
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(DWORD_PTR);
DPRINT("Enter NtUserCallTwoParam\n");
wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
- RETURN( UserUpdateUiState(Window->Wnd, wParam) );
+ RETURN( UserUpdateUiState(Window, wParam) );
}
case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
DWORD Routine)
{
BOOL Ret = 0;
- PWINDOW_OBJECT Window;
- PWND Wnd;
+ PWND Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOLEAN);
DPRINT("Enter NtUserCallHwndLock\n");
UserEnterExclusive();
- if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
}
UserRefObjectCo(Window, &Ref);
- Wnd = Window->Wnd;
-
/* FIXME: Routine can be 0x53 - 0x5E */
switch (Routine)
{
{
DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
Ret = TRUE;
- if ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
+ if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
co_WinPosSetWindowPos( Window,
HWND_DESKTOP,
0,0,0,0,
{
case HWND_ROUTINE_GETWNDCONTEXTHLPID:
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PPROPERTY HelpId;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
- if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if (!(Window = UserGetWindowObject(hWnd)))
{
UserLeave();
return 0;
case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
{
- PWINDOW_OBJECT Window;
+ PWND Window;
UserEnterExclusive();
if(!(Window = UserGetWindowObject(hWnd)))
case HWNDPARAM_ROUTINE_SETDIALOGPOINTER:
{
- PWINDOW_OBJECT Window;
PWND pWnd;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
- if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if (!(pWnd = UserGetWindowObject(hWnd)))
{
UserLeave();
return 0;
}
- UserRefObjectCo(Window, &Ref);
+ UserRefObjectCo(pWnd, &Ref);
- pWnd = Window->Wnd;
if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
pWnd->cbwndExtra == DLGWINDOWEXTRA &&
!(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
}
}
- UserDerefObjectCo(Window);
+ UserDerefObjectCo(pWnd);
UserLeave();
return 0;
}
DWORD Routine)
{
DWORD Ret = 0;
- PWINDOW_OBJECT Window;
+ PWND Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(DWORD);
DPRINT1("Enter NtUserCallHwndParamLock\n");
UserEnterExclusive();
- if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
}
PTIMER
FASTCALL
-FindTimer(PWINDOW_OBJECT Window,
+FindTimer(PWND Window,
UINT_PTR nID,
UINT flags)
{
}
UINT_PTR FASTCALL
-IntSetTimer( PWINDOW_OBJECT Window,
+IntSetTimer( PWND Window,
UINT_PTR IDEvent,
UINT Elapse,
TIMERPROC TimerFunc,
if (!pTmr) return 0;
if (Window && (Type & TMRF_TIFROMWND))
- pTmr->pti = Window->pti->pEThread->Tcb.Win32Thread;
+ pTmr->pti = Window->head.pti->pEThread->Tcb.Win32Thread;
else
{
if (Type & TMRF_RIT)
UINT_PTR
FASTCALL
-SystemTimerSet( PWINDOW_OBJECT Window,
+SystemTimerSet( PWND Window,
UINT_PTR nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc)
{
- if (Window && Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
+ if (Window && Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
DPRINT("SysemTimerSet: Access Denied!\n");
BOOL
FASTCALL
-PostTimerMessages(PWINDOW_OBJECT Window)
+PostTimerMessages(PWND Window)
{
PLIST_ENTRY pLE;
PUSER_MESSAGE_QUEUE ThreadQueue;
(pTmr->pti == pti) &&
((pTmr->pWnd == Window) || (Window == NULL)) )
{
- Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->hSelf : 0;
+ Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->head.h : 0;
Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
Msg.wParam = (WPARAM) pTmr->nID;
Msg.lParam = (LPARAM) pTmr->pfn;
}
BOOL FASTCALL
-DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window)
+DestroyTimersForWindow(PTHREADINFO pti, PWND Window)
{
PLIST_ENTRY pLE;
PTIMER pTmr = FirstpTmr;
}
BOOL FASTCALL
-IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer)
+IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
{
PTIMER pTmr = NULL;
DPRINT("IntKillTimer Window %x id %p systemtimer %s\n",
TIMERPROC lpTimerFunc
)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(UINT_PTR);
DPRINT("Enter NtUserSetTimer\n");
UINT_PTR uIDEvent
)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserKillTimer\n");
HRGN FASTCALL
VIS_ComputeVisibleRegion(
- PWINDOW_OBJECT Window,
+ PWND Wnd,
BOOLEAN ClientArea,
BOOLEAN ClipChildren,
BOOLEAN ClipSiblings)
{
HRGN VisRgn, ClipRgn;
- PWINDOW_OBJECT PreviousWindow, CurrentWindow, CurrentSibling;
- PWND Wnd, CurrentWnd, PreviousWnd, CurrentSiblingWnd;
-
- Wnd = Window->Wnd;
+ PWND PreviousWindow, CurrentWindow, CurrentSibling;
if (!Wnd || !(Wnd->style & WS_VISIBLE))
{
if (ClientArea)
{
- VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ VisRgn = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
}
else
{
- VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ VisRgn = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
}
/*
* our window.
*/
- PreviousWindow = Window;
- PreviousWnd = PreviousWindow->Wnd;
- CurrentWindow = Window->spwndParent;
+ PreviousWindow = Wnd;
+ CurrentWindow = Wnd->spwndParent;
while (CurrentWindow)
{
- if ( CurrentWindow->state & WINDOWSTATUS_DESTROYING || // state2
- CurrentWindow->state & WINDOWSTATUS_DESTROYED )
+ if ( CurrentWindow->state2 & WNDS2_INDESTROY ||
+ CurrentWindow->state & WNDS_DESTROYED )
{
DPRINT1("ATM the Current Window or Parent is dead!\n");
if (VisRgn) REGION_FreeRgnByHandle(VisRgn);
return NULL;
}
- CurrentWnd = CurrentWindow->Wnd;
- if (!CurrentWnd || !(CurrentWnd->style & WS_VISIBLE))
+ if (!(CurrentWindow->style & WS_VISIBLE))
{
if (VisRgn) REGION_FreeRgnByHandle(VisRgn);
return NULL;
}
- ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcClient);
+ ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWindow->rcClient);
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND);
REGION_FreeRgnByHandle(ClipRgn);
- if ((PreviousWnd->style & WS_CLIPSIBLINGS) ||
- (PreviousWnd == Wnd && ClipSiblings))
+ if ((PreviousWindow->style & WS_CLIPSIBLINGS) ||
+ (PreviousWindow == Wnd && ClipSiblings))
{
CurrentSibling = CurrentWindow->spwndChild;
while ( CurrentSibling != NULL &&
- CurrentSibling != PreviousWindow &&
- CurrentSibling->Wnd )
+ CurrentSibling != PreviousWindow )
{
- CurrentSiblingWnd = CurrentSibling->Wnd;
- if ((CurrentSiblingWnd->style & WS_VISIBLE) &&
- !(CurrentSiblingWnd->ExStyle & WS_EX_TRANSPARENT))
+ if ((CurrentSibling->style & WS_VISIBLE) &&
+ !(CurrentSibling->ExStyle & WS_EX_TRANSPARENT))
{
- ClipRgn = IntSysCreateRectRgnIndirect(&CurrentSiblingWnd->rcWindow);
+ ClipRgn = IntSysCreateRectRgnIndirect(&CurrentSibling->rcWindow);
/* Combine it with the window region if available */
- if (CurrentSibling->hrgnClip && !(CurrentSiblingWnd->style & WS_MINIMIZE))
+ if (CurrentSibling->hrgnClip && !(CurrentSibling->style & WS_MINIMIZE))
{
- NtGdiOffsetRgn(ClipRgn, -CurrentSiblingWnd->rcWindow.left, -CurrentSiblingWnd->rcWindow.top);
+ NtGdiOffsetRgn(ClipRgn, -CurrentSibling->rcWindow.left, -CurrentSibling->rcWindow.top);
NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentSibling->hrgnClip, RGN_AND);
- NtGdiOffsetRgn(ClipRgn, CurrentSiblingWnd->rcWindow.left, CurrentSiblingWnd->rcWindow.top);
+ NtGdiOffsetRgn(ClipRgn, CurrentSibling->rcWindow.left, CurrentSibling->rcWindow.top);
}
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
REGION_FreeRgnByHandle(ClipRgn);
}
PreviousWindow = CurrentWindow;
- PreviousWnd = PreviousWindow->Wnd;
CurrentWindow = CurrentWindow->spwndParent;
}
if (ClipChildren)
{
- CurrentWindow = Window->spwndChild;
- while (CurrentWindow && CurrentWindow->Wnd)
+ CurrentWindow = Wnd->spwndChild;
+ while (CurrentWindow)
{
- CurrentWnd = CurrentWindow->Wnd;
- if ((CurrentWnd->style & WS_VISIBLE) &&
- !(CurrentWnd->ExStyle & WS_EX_TRANSPARENT))
+ if ((CurrentWindow->style & WS_VISIBLE) &&
+ !(CurrentWindow->ExStyle & WS_EX_TRANSPARENT))
{
- ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcWindow);
+ ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWindow->rcWindow);
/* Combine it with the window region if available */
- if (CurrentWindow->hrgnClip && !(CurrentWnd->style & WS_MINIMIZE))
+ if (CurrentWindow->hrgnClip && !(CurrentWindow->style & WS_MINIMIZE))
{
- NtGdiOffsetRgn(ClipRgn, -CurrentWnd->rcWindow.left, -CurrentWnd->rcWindow.top);
+ NtGdiOffsetRgn(ClipRgn, -CurrentWindow->rcWindow.left, -CurrentWindow->rcWindow.top);
NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentWindow->hrgnClip, RGN_AND);
- NtGdiOffsetRgn(ClipRgn, CurrentWnd->rcWindow.left, CurrentWnd->rcWindow.top);
+ NtGdiOffsetRgn(ClipRgn, CurrentWindow->rcWindow.left, CurrentWindow->rcWindow.top);
}
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
REGION_FreeRgnByHandle(ClipRgn);
}
}
- if (Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
+ if (Wnd->hrgnClip && !(Wnd->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(VisRgn, -Wnd->rcWindow.left, -Wnd->rcWindow.top);
- NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
+ NtGdiCombineRgn(VisRgn, VisRgn, Wnd->hrgnClip, RGN_AND);
NtGdiOffsetRgn(VisRgn, Wnd->rcWindow.left, Wnd->rcWindow.top);
}
VOID FASTCALL
co_VIS_WindowLayoutChanged(
- PWINDOW_OBJECT Window,
+ PWND Wnd,
HRGN NewlyExposed)
{
HRGN Temp;
- PWINDOW_OBJECT Parent;
+ PWND Parent;
USER_REFERENCE_ENTRY Ref;
- PWND Wnd, ParentWnd;
-
- ASSERT_REFS_CO(Window);
- Wnd = Window->Wnd;
+ ASSERT_REFS_CO(Wnd);
Temp = IntSysCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(Temp, NewlyExposed, NULL, RGN_COPY);
- Parent = Window->spwndParent;
+ Parent = Wnd->spwndParent;
if(Parent)
{
- ParentWnd = Parent->Wnd;
NtGdiOffsetRgn(Temp,
- Wnd->rcWindow.left - ParentWnd->rcClient.left,
- Wnd->rcWindow.top - ParentWnd->rcClient.top);
+ Wnd->rcWindow.left - Parent->rcClient.left,
+ Wnd->rcWindow.top - Parent->rcClient.top);
UserRefObjectCo(Parent, &Ref);
co_UserRedrawWindow(Parent, NULL, Temp,
static
HRGN FASTCALL
-DceGetVisRgn(PWINDOW_OBJECT Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
+DceGetVisRgn(PWND Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
{
HRGN VisRgn;
}
PDCE FASTCALL
-DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
+DceAllocDCE(PWND Window OPTIONAL, DCE_TYPE Type)
{
PDCE pDce;
- PWND Wnd = NULL;
-
- if (Window) Wnd = Window->Wnd;
pDce = ExAllocatePoolWithTag(PagedPool, sizeof(DCE), TAG_PDCE);
if(!pDce)
}
DCECount++;
DPRINT("Alloc DCE's! %d\n",DCECount);
- pDce->hwndCurrent = (Window ? Window->hSelf : NULL);
- pDce->pwndOrg = Wnd;
- pDce->pwndClip = Wnd;
+ pDce->hwndCurrent = (Window ? Window->head.h : NULL);
+ pDce->pwndOrg = Window;
+ pDce->pwndClip = Window;
pDce->hrgnClip = NULL;
pDce->hrgnClipPublic = NULL;
pDce->hrgnSavedVis = NULL;
else
{
pDce->DCXFlags = DCX_DCEBUSY;
- if (Wnd)
+ if (Window)
{
if (Type == DCE_WINDOW_DC)
{
- if (Wnd->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
- if (Wnd->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
+ if (Window->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
+ if (Window->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
}
}
}
}
static VOID APIENTRY
-DceSetDrawable( PWINDOW_OBJECT Window OPTIONAL,
+DceSetDrawable( PWND Window OPTIONAL,
HDC hDC,
ULONG Flags,
BOOL SetClipOrigin)
{
- PWND Wnd;
DC *dc = DC_LockDc(hDC);
if(!dc)
return;
}
else
{
- Wnd = Window->Wnd;
if (Flags & DCX_WINDOW)
{
- dc->ptlDCOrig.x = Wnd->rcWindow.left;
- dc->ptlDCOrig.y = Wnd->rcWindow.top;
+ dc->ptlDCOrig.x = Window->rcWindow.left;
+ dc->ptlDCOrig.y = Window->rcWindow.top;
}
else
{
- dc->ptlDCOrig.x = Wnd->rcClient.left;
- dc->ptlDCOrig.y = Wnd->rcClient.top;
+ dc->ptlDCOrig.x = Window->rcClient.left;
+ dc->ptlDCOrig.y = Window->rcClient.top;
}
}
DC_UnlockDc(dc);
}
static VOID FASTCALL
-DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
+DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags)
{
HANDLE hRgnVisible = NULL;
ULONG DcxFlags;
- PWINDOW_OBJECT DesktopWindow;
+ PWND DesktopWindow;
if (Flags & DCX_PARENTCLIP)
{
- PWINDOW_OBJECT Parent;
- PWND ParentWnd;
+ PWND Parent;
Parent = Window->spwndParent;
if(!Parent)
goto noparent;
}
- ParentWnd = Parent->Wnd;
-
- if (ParentWnd->style & WS_CLIPSIBLINGS)
+ if (Parent->style & WS_CLIPSIBLINGS)
{
DcxFlags = DCX_CLIPSIBLINGS |
(Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW));
{
DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW);
}
- hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->hSelf, Flags);
+ hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags);
}
else if (Window == NULL)
{
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if (NULL != DesktopWindow)
{
- hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->Wnd->rcWindow);
+ hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->rcWindow);
}
else
{
}
HDC FASTCALL
-UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
+UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
{
- PWINDOW_OBJECT Parent;
+ PWND Parent;
ULONG DcxFlags;
DCE* Dce = NULL;
BOOL UpdateClipOrigin = FALSE;
- PWND Wnd = NULL;
HDC hDC = NULL;
PPROCESSINFO ppi;
PLIST_ENTRY pLE;
- if (NULL == Window)
+ if (NULL == Wnd)
{
Flags &= ~DCX_USESTYLE;
Flags |= DCX_CACHE;
}
- else
- Wnd = Window->Wnd;
if (Flags & (DCX_WINDOW | DCX_PARENTCLIP)) Flags |= DCX_CACHE;
Flags &= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
}
- Parent = (Window ? Window->spwndParent : NULL);
+ Parent = (Wnd ? Wnd->spwndParent : NULL);
- if (NULL == Window || !(Wnd->style & WS_CHILD) || NULL == Parent)
+ if (NULL == Wnd || !(Wnd->style & WS_CHILD) || NULL == Parent)
{
Flags &= ~DCX_PARENTCLIP;
Flags |= DCX_CLIPSIBLINGS;
if (Flags & DCX_PARENTCLIP)
{
if ((Wnd->style & WS_VISIBLE) &&
- (Parent->Wnd->style & WS_VISIBLE))
+ (Parent->style & WS_VISIBLE))
{
Flags &= ~DCX_CLIPCHILDREN;
- if (Parent->Wnd->style & WS_CLIPSIBLINGS)
+ if (Parent->style & WS_CLIPSIBLINGS)
{
Flags |= DCX_CLIPSIBLINGS;
}
{
DceEmpty = Dce;
}
- else if (Dce->hwndCurrent == (Window ? Window->hSelf : NULL) &&
+ else if (Dce->hwndCurrent == (Wnd ? Wnd->head.h : NULL) &&
((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags))
{
UpdateClipOrigin = TRUE;
}
if (!Dce) return NULL;
- Dce->hwndCurrent = (Window ? Window->hSelf : NULL);
+ Dce->hwndCurrent = (Wnd ? Wnd->head.h : NULL);
}
else // If we are here, we are POWNED or having CLASS.
{
Dce = CONTAINING_RECORD(pLE, DCE, List);
do
{ // Check for Window handle than HDC match for CLASS.
- if ((Dce->hwndCurrent == Window->hSelf) ||
+ if ((Dce->hwndCurrent == Wnd->head.h) ||
(Dce->hDC == hDC))
break;
pLE = Dce->List.Flink;
{
Flags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;
Dce->DCXFlags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;
- ClipRegion = Window->hrgnUpdate;
+ ClipRegion = Wnd->hrgnUpdate;
}
if (ClipRegion == (HRGN) 1)
{
if (!(Flags & DCX_WINDOW))
{
- Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+ Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
}
else
{
- Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+ Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
}
Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
}
Dce->hrgnClip = ClipRegion;
}
- DceSetDrawable(Window, Dce->hDC, Flags, UpdateClipOrigin);
+ DceSetDrawable(Wnd, Dce->hDC, Flags, UpdateClipOrigin);
- DceUpdateVisRgn(Dce, Window, Flags);
+ DceUpdateVisRgn(Dce, Wnd, Flags);
if (Dce->DCXFlags & DCX_CACHE)
{
* Remove owned DCE and reset unreleased cache DCEs.
*/
void FASTCALL
-DceFreeWindowDCE(PWINDOW_OBJECT Window)
+DceFreeWindowDCE(PWND Window)
{
PDCE pDCE;
PLIST_ENTRY pLE;
DPRINT1("FreeWindowDCE List is Empty!!!!\n");
break;
}
- if ( pDCE->hwndCurrent == Window->hSelf &&
+ if ( pDCE->hwndCurrent == Window->head.h &&
!(pDCE->DCXFlags & DCX_DCEEMPTY) )
{
if (!(pDCE->DCXFlags & DCX_CACHE)) /* owned or Class DCE*/
{
- if (Window->Wnd->pcls->style & CS_CLASSDC) /* Test Class first */
+ if (Window->pcls->style & CS_CLASSDC) /* Test Class first */
{
if (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE*/
DceDeleteClipRgn(pDCE);
}
/* Do not change owner so thread can clean up! */
}
- else if (Window->Wnd->pcls->style & CS_OWNDC) /* owned DCE*/
+ else if (Window->pcls->style & CS_OWNDC) /* owned DCE*/
{
pDCE = DceFreeDCE(pDCE, FALSE);
if (!pDCE) break;
* We should change this to DPRINT when ReactOS is more stable
* (for 1.0?).
*/
- DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->hSelf);
+ DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->head.h);
DceReleaseDC(pDCE, FALSE);
}
pDCE->DCXFlags |= DCX_DCEEMPTY;
}
VOID FASTCALL
-DceResetActiveDCEs(PWINDOW_OBJECT Window)
+DceResetActiveDCEs(PWND Window)
{
DCE *pDCE;
PDC dc;
- PWINDOW_OBJECT CurrentWindow;
+ PWND CurrentWindow;
INT DeltaX;
INT DeltaY;
PLIST_ENTRY pLE;
if(pLE == &LEDce) break;
if (0 == (pDCE->DCXFlags & (DCX_DCEEMPTY|DCX_INDESTROY)))
{
- if (Window->hSelf == pDCE->hwndCurrent)
+ if (Window->head.h == pDCE->hwndCurrent)
{
CurrentWindow = Window;
}
{
if (pDCE->DCXFlags & DCX_WINDOW)
{
- DeltaX = CurrentWindow->Wnd->rcWindow.left - dc->ptlDCOrig.x;
- DeltaY = CurrentWindow->Wnd->rcWindow.top - dc->ptlDCOrig.y;
- dc->ptlDCOrig.x = CurrentWindow->Wnd->rcWindow.left;
- dc->ptlDCOrig.y = CurrentWindow->Wnd->rcWindow.top;
+ DeltaX = CurrentWindow->rcWindow.left - dc->ptlDCOrig.x;
+ DeltaY = CurrentWindow->rcWindow.top - dc->ptlDCOrig.y;
+ dc->ptlDCOrig.x = CurrentWindow->rcWindow.left;
+ dc->ptlDCOrig.y = CurrentWindow->rcWindow.top;
}
else
{
- DeltaX = CurrentWindow->Wnd->rcClient.left - dc->ptlDCOrig.x;
- DeltaY = CurrentWindow->Wnd->rcClient.top - dc->ptlDCOrig.y;
- dc->ptlDCOrig.x = CurrentWindow->Wnd->rcClient.left;
- dc->ptlDCOrig.y = CurrentWindow->Wnd->rcClient.top;
+ DeltaX = CurrentWindow->rcClient.left - dc->ptlDCOrig.x;
+ DeltaY = CurrentWindow->rcClient.top - dc->ptlDCOrig.y;
+ dc->ptlDCOrig.x = CurrentWindow->rcClient.left;
+ dc->ptlDCOrig.y = CurrentWindow->rcClient.top;
}
if (NULL != dc->rosdc.hClipRgn)
{
DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags);
- if (Window->hSelf != pDCE->hwndCurrent)
+ if (Window->head.h != pDCE->hwndCurrent)
{
// IntEngWindowChanged(CurrentWindow, WOC_RGN_CLIENT);
// UserDerefObject(CurrentWindow);
}
INT FASTCALL
-UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint)
+UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
{
PDCE dce;
PLIST_ENTRY pLE;
}
HDC FASTCALL
-UserGetWindowDC(PWINDOW_OBJECT Wnd)
+UserGetWindowDC(PWND Wnd)
{
return UserGetDCEx(Wnd, 0, DCX_USESTYLE | DCX_WINDOW);
}
UserGethWnd( HDC hdc, PWNDOBJ *pwndo)
{
PWNDGDI pWndgdi;
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
HWND hWnd;
hWnd = IntWindowFromDC(hdc);
HDC APIENTRY
NtUserGetDCEx(HWND hWnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
{
- PWINDOW_OBJECT Wnd=NULL;
+ PWND Wnd=NULL;
DECLARE_RETURN(HDC);
DPRINT("Enter NtUserGetDCEx\n");
return TRUE;
}
-PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd)
+PWND FASTCALL IntGetWindowObject(HWND hWnd)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
if (!hWnd) return NULL;
ASSERT(Window->head.cLockObj >= 0);
Window->head.cLockObj++;
-
- ASSERT(Window->Wnd);
}
return Window;
}
/* temp hack */
-PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
+PWND FASTCALL UserGetWindowObject(HWND hWnd)
{
PTHREADINFO ti;
- PWINDOW_OBJECT Window;
+ PWND Window;
if (PsGetCurrentProcess() != PsInitialSystemProcess)
{
return NULL;
}
- Window = (PWINDOW_OBJECT)UserGetObject(gHandleTable, hWnd, otWindow);
- if (!Window || 0 != (Window->state & WINDOWSTATUS_DESTROYED))
+ Window = (PWND)UserGetObject(gHandleTable, hWnd, otWindow);
+ if (!Window || 0 != (Window->state & WNDS_DESTROYED))
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return NULL;
ASSERT(Window->head.cLockObj >= 0);
- ASSERT(Window->Wnd);
-
return Window;
}
BOOL FASTCALL
IntIsWindow(HWND hWnd)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
if (!(Window = UserGetWindowObject(hWnd)))
return FALSE;
-PWINDOW_OBJECT FASTCALL
-IntGetParent(PWINDOW_OBJECT Wnd)
+PWND FASTCALL
+IntGetParent(PWND Wnd)
{
- if (Wnd->Wnd->style & WS_POPUP)
+ if (Wnd->style & WS_POPUP)
{
return Wnd->spwndOwner;
}
- else if (Wnd->Wnd->style & WS_CHILD)
+ else if (Wnd->style & WS_CHILD)
{
return Wnd->spwndParent;
}
*/
HWND* FASTCALL
-IntWinListChildren(PWINDOW_OBJECT Window)
+IntWinListChildren(PWND Window)
{
- PWINDOW_OBJECT Child;
+ PWND Child;
HWND *List;
UINT Index, NumChildren = 0;
for (Child = Window->spwndChild, Index = 0;
Child != NULL;
Child = Child->spwndNext, ++Index)
- List[Index] = Child->hSelf;
+ List[Index] = Child->head.h;
List[Index] = NULL;
return List;
static void IntSendDestroyMsg(HWND hWnd)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
#if 0 /* FIXME */
GUITHREADINFO info;
}
static VOID
-UserFreeWindowInfo(PTHREADINFO ti, PWINDOW_OBJECT WindowObject)
+UserFreeWindowInfo(PTHREADINFO ti, PWND Wnd)
{
PCLIENTINFO ClientInfo = GetWin32ClientInfo();
- PWND Wnd = WindowObject->Wnd;
if (!Wnd) return;
- if (ClientInfo->CallbackWnd.pvWnd == DesktopHeapAddressToUser(WindowObject->Wnd))
+ if (ClientInfo->CallbackWnd.pWnd == DesktopHeapAddressToUser(Wnd))
{
ClientInfo->CallbackWnd.hWnd = NULL;
- ClientInfo->CallbackWnd.pvWnd = NULL;
+ ClientInfo->CallbackWnd.pWnd = NULL;
}
if (Wnd->strName.Buffer != NULL)
Wnd->strName.Buffer = NULL;
}
- DesktopHeapFree(Wnd->head.rpdesk, Wnd);
- WindowObject->Wnd = NULL;
+// DesktopHeapFree(Wnd->head.rpdesk, Wnd);
+// WindowObject->Wnd = NULL;
}
/***********************************************************************
* done in CreateWindow is undone here and not in DestroyWindow:-P
*/
-static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
+static LRESULT co_UserFreeWindow(PWND Window,
PPROCESSINFO ProcessData,
PTHREADINFO ThreadData,
BOOLEAN SendMessages)
{
HWND *Children;
HWND *ChildHandle;
- PWINDOW_OBJECT Child;
+ PWND Child;
PMENU_OBJECT Menu;
BOOLEAN BelongsToThreadData;
- PWND Wnd;
ASSERT(Window);
- Wnd = Window->Wnd;
-
- if(Window->state & WINDOWSTATUS_DESTROYING)
+ if(Window->state2 & WNDS2_INDESTROY)
{
DPRINT("Tried to call IntDestroyWindow() twice\n");
return 0;
}
- Window->state |= WINDOWSTATUS_DESTROYING;
- Wnd->style &= ~WS_VISIBLE;
+ Window->state2 |= WNDS2_INDESTROY;
+ Window->style &= ~WS_VISIBLE;
- IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Wnd, OBJID_WINDOW, 0);
+ IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Window, OBJID_WINDOW, 0);
/* 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
BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData);
- IntDeRegisterShellHookWindow(Window->hSelf);
+ IntDeRegisterShellHookWindow(Window->head.h);
if(SendMessages)
{
/* Send destroy messages */
- IntSendDestroyMsg(Window->hSelf);
+ IntSendDestroyMsg(Window->head.h);
}
/* free child windows */
if(!IntWndBelongsToThread(Child, ThreadData))
{
/* send WM_DESTROY messages to windows not belonging to the same thread */
- IntSendDestroyMsg(Child->hSelf);
+ IntSendDestroyMsg(Child->head.h);
}
else
co_UserFreeWindow(Child, ProcessData, ThreadData, SendMessages);
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE |
RDW_NOINTERNALPAINT | RDW_NOCHILDREN);
if(BelongsToThreadData)
- co_IntSendMessage(Window->hSelf, WM_NCDESTROY, 0, 0);
+ co_IntSendMessage(Window->head.h, WM_NCDESTROY, 0, 0);
}
DestroyTimersForWindow(ThreadData, Window);
HOOK_DestroyThreadHooks(ThreadData->pEThread); // This is needed here too!
MsqRemoveWindowMessagesFromQueue(Window);
/* from now on no messages can be sent to this window anymore */
- Window->state |= WINDOWSTATUS_DESTROYED;
- Wnd->state |= WNDS_DESTROYED;
- Wnd->fnid |= FNID_FREED;
+ Window->state |= WNDS_DESTROYED;
+ Window->fnid |= FNID_FREED;
/* don't remove the WINDOWSTATUS_DESTROYING bit */
/* reset shell window handles */
if(ThreadData->rpdesk)
{
- if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
+ if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
ThreadData->rpdesk->rpwinstaParent->ShellWindow = NULL;
- if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellListView)
+ if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellListView)
ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL;
}
#if 0 /* FIXME */
- WinPosCheckInternalPos(Window->hSelf);
- if (Window->hSelf == GetCapture())
+ WinPosCheckInternalPos(Window->head.h);
+ if (Window->head.h == GetCapture())
{
ReleaseCapture();
}
/* free resources associated with the window */
- TIMER_RemoveWindowTimers(Window->hSelf);
+ TIMER_RemoveWindowTimers(Window->head.h);
#endif
- if (!(Wnd->style & WS_CHILD) && Wnd->IDMenu
- && (Menu = UserGetMenuObject((HMENU)Wnd->IDMenu)))
+ if (!(Window->style & WS_CHILD) && Window->IDMenu
+ && (Menu = UserGetMenuObject((HMENU)Window->IDMenu)))
{
IntDestroyMenuObject(Menu, TRUE, TRUE);
- Wnd->IDMenu = 0;
+ Window->IDMenu = 0;
}
if(Window->SystemMenu
IntUnlinkWindow(Window);
UserReferenceObject(Window);
- UserDeleteObject(Window->hSelf, otWindow);
+ UserDeleteObject(Window->head.h, otWindow);
IntDestroyScrollBars(Window);
/* dereference the class */
- IntDereferenceClass(Wnd->pcls,
- Window->pti->pDeskInfo,
- Window->pti->ppi);
- Wnd->pcls = NULL;
+ IntDereferenceClass(Window->pcls,
+ Window->head.pti->pDeskInfo,
+ Window->head.pti->ppi);
+ Window->pcls = NULL;
if(Window->hrgnClip)
{
GreDeleteObject(Window->hrgnClip);
}
- ASSERT(Window->Wnd != NULL);
- UserFreeWindowInfo(Window->pti, Window);
+// ASSERT(Window != NULL);
+ UserFreeWindowInfo(Window->head.pti, Window);
UserDereferenceObject(Window);
}
VOID FASTCALL
-IntGetWindowBorderMeasures(PWINDOW_OBJECT Window, UINT *cx, UINT *cy)
+IntGetWindowBorderMeasures(PWND Wnd, UINT *cx, UINT *cy)
{
- PWND Wnd = Window->Wnd;
if(HAS_DLGFRAME(Wnd->style, Wnd->ExStyle) && !(Wnd->style & WS_MINIMIZE))
{
*cx = UserGetSystemMetrics(SM_CXDLGFRAME);
// Move this to user space!
BOOL FASTCALL
-IntGetWindowInfo(PWINDOW_OBJECT Window, PWINDOWINFO pwi)
+IntGetWindowInfo(PWND Wnd, PWINDOWINFO pwi)
{
- PWND Wnd = Window->Wnd;
-
pwi->cbSize = sizeof(WINDOWINFO);
- pwi->rcWindow = Window->Wnd->rcWindow;
- pwi->rcClient = Window->Wnd->rcClient;
+ pwi->rcWindow = Wnd->rcWindow;
+ pwi->rcClient = Wnd->rcClient;
pwi->dwStyle = Wnd->style;
pwi->dwExStyle = Wnd->ExStyle;
- pwi->dwWindowStatus = (UserGetForegroundWindow() == Window->hSelf); /* WS_ACTIVECAPTION */
- IntGetWindowBorderMeasures(Window, &pwi->cxWindowBorders, &pwi->cyWindowBorders);
+ pwi->dwWindowStatus = (UserGetForegroundWindow() == Wnd->head.h); /* WS_ACTIVECAPTION */
+ IntGetWindowBorderMeasures(Wnd, &pwi->cxWindowBorders, &pwi->cyWindowBorders);
pwi->atomWindowType = (Wnd->pcls ? Wnd->pcls->atomClassName : 0);
pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */
return TRUE;
static BOOL FASTCALL
IntSetMenu(
- PWINDOW_OBJECT Window,
+ PWND Wnd,
HMENU Menu,
BOOL *Changed)
{
PMENU_OBJECT OldMenu, NewMenu = NULL;
- PWND Wnd = Window->Wnd;
if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
if (Wnd->IDMenu)
{
OldMenu = IntGetMenuObject((HMENU) Wnd->IDMenu);
- ASSERT(NULL == OldMenu || OldMenu->MenuInfo.Wnd == Window->hSelf);
+ ASSERT(NULL == OldMenu || OldMenu->MenuInfo.Wnd == Wnd->head.h);
}
else
{
Wnd->IDMenu = (UINT) Menu;
if (NULL != NewMenu)
{
- NewMenu->MenuInfo.Wnd = Window->hSelf;
+ NewMenu->MenuInfo.Wnd = Wnd->head.h;
IntReleaseMenuObject(NewMenu);
}
if (NULL != OldMenu)
{
PTHREADINFO WThread;
PLIST_ENTRY Current;
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
USER_REFERENCE_ENTRY Ref;
WThread = (PTHREADINFO)Thread->Tcb.Win32Thread;
while (!IsListEmpty(&WThread->WindowListHead))
{
Current = WThread->WindowListHead.Flink;
- Wnd = CONTAINING_RECORD(Current, WINDOW_OBJECT, ThreadListEntry);
+ Wnd = CONTAINING_RECORD(Current, WND, ThreadListEntry);
DPRINT("thread cleanup: while destroy wnds, wnd=0x%x\n",Wnd);
* \note Does not check the validity of the parameters
*/
VOID FASTCALL
-IntGetClientRect(PWINDOW_OBJECT Window, RECTL *Rect)
+IntGetClientRect(PWND Window, RECTL *Rect)
{
ASSERT( Window );
ASSERT( Rect );
Rect->left = Rect->top = 0;
- Rect->right = Window->Wnd->rcClient.right - Window->Wnd->rcClient.left;
- Rect->bottom = Window->Wnd->rcClient.bottom - Window->Wnd->rcClient.top;
+ Rect->right = Window->rcClient.right - Window->rcClient.left;
+ Rect->bottom = Window->rcClient.bottom - Window->rcClient.top;
}
#endif
PMENU_OBJECT FASTCALL
-IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu)
+IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
{
PMENU_OBJECT Menu, NewMenu = NULL, SysMenu = NULL, ret = NULL;
PTHREADINFO W32Thread;
{
Window->SystemMenu = NewMenu->MenuInfo.Self;
NewMenu->MenuInfo.Flags |= MF_SYSMENU;
- NewMenu->MenuInfo.Wnd = Window->hSelf;
+ NewMenu->MenuInfo.Wnd = Window->head.h;
ret = NewMenu;
//IntReleaseMenuObject(NewMenu);
}
return NULL;
}
SysMenu->MenuInfo.Flags |= MF_SYSMENU;
- SysMenu->MenuInfo.Wnd = Window->hSelf;
+ SysMenu->MenuInfo.Wnd = Window->head.h;
hNewMenu = co_IntLoadSysMenuTemplate();
if(!hNewMenu)
{
BOOL FASTCALL
-IntIsChildWindow(PWINDOW_OBJECT Parent, PWINDOW_OBJECT BaseWindow)
+IntIsChildWindow(PWND Parent, PWND BaseWindow)
{
- PWINDOW_OBJECT Window;
- PWND Wnd;
+ PWND Window;
Window = BaseWindow;
while (Window)
{
- Wnd = Window->Wnd;
if (Window == Parent)
{
return(TRUE);
}
- if(!(Wnd->style & WS_CHILD))
+ if(!(Window->style & WS_CHILD))
{
break;
}
}
BOOL FASTCALL
-IntIsWindowVisible(PWINDOW_OBJECT BaseWindow)
+IntIsWindowVisible(PWND BaseWindow)
{
- PWINDOW_OBJECT Window;
- PWND Wnd;
+ PWND Window;
Window = BaseWindow;
while(Window)
{
- Wnd = Window->Wnd;
- if(!(Wnd->style & WS_CHILD))
+ if(!(Window->style & WS_CHILD))
{
break;
}
- if(!(Wnd->style & WS_VISIBLE))
+ if(!(Window->style & WS_VISIBLE))
{
return FALSE;
}
Window = Window->spwndParent;
}
- if(Window && Wnd->style & WS_VISIBLE)
+ if(Window && Window->style & WS_VISIBLE)
{
return TRUE;
}
}
-static VOID FASTCALL
-IntLinkWnd(
- PWND Wnd,
- PWND WndInsertAfter) /* set to NULL if top sibling */
-{
- if ((Wnd->spwndPrev = WndInsertAfter))
- {
- /* link after WndInsertAfter */
- if ((Wnd->spwndNext = WndInsertAfter->spwndNext))
- Wnd->spwndNext->spwndPrev = Wnd;
-
- Wnd->spwndPrev->spwndNext = Wnd;
- }
- else
- {
- /* link at top */
- if ((Wnd->spwndNext = Wnd->spwndParent->spwndChild))
- Wnd->spwndNext->spwndPrev = Wnd;
-
- Wnd->spwndParent->spwndChild = Wnd;
- }
-}
-
/*
link the window into siblings list
children and parent are kept in place.
*/
VOID FASTCALL
IntLinkWindow(
- PWINDOW_OBJECT Wnd,
- PWINDOW_OBJECT WndInsertAfter /* set to NULL if top sibling */
+ PWND Wnd,
+ PWND WndInsertAfter /* set to NULL if top sibling */
)
{
- IntLinkWnd(Wnd->Wnd,
- WndInsertAfter ? WndInsertAfter->Wnd : NULL);
-
if ((Wnd->spwndPrev = WndInsertAfter))
{
/* link after WndInsertAfter */
}
-VOID FASTCALL IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev)
+VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev)
{
if (hWndPrev == HWND_NOTOPMOST)
{
- if (!(Wnd->Wnd->ExStyle & WS_EX_TOPMOST) &&
- (Wnd->Wnd->ExStyle2 & WS_EX2_LINKED)) return; /* nothing to do */
- Wnd->Wnd->ExStyle &= ~WS_EX_TOPMOST;
+ if (!(Wnd->ExStyle & WS_EX_TOPMOST) &&
+ (Wnd->ExStyle2 & WS_EX2_LINKED)) return; /* nothing to do */
+ Wnd->ExStyle &= ~WS_EX_TOPMOST;
hWndPrev = HWND_TOP; /* fallback to the HWND_TOP case */
}
if (hWndPrev == HWND_BOTTOM)
{
/* Link in the bottom of the list */
- PWINDOW_OBJECT WndInsertAfter;
+ PWND WndInsertAfter;
WndInsertAfter = Wnd->spwndParent->spwndChild;
while( WndInsertAfter && WndInsertAfter->spwndNext)
WndInsertAfter = WndInsertAfter->spwndNext;
IntLinkWindow(Wnd, WndInsertAfter);
- Wnd->Wnd->ExStyle &= ~WS_EX_TOPMOST;
+ Wnd->ExStyle &= ~WS_EX_TOPMOST;
}
else if (hWndPrev == HWND_TOPMOST)
{
/* Link in the top of the list */
IntLinkWindow(Wnd, NULL);
- Wnd->Wnd->ExStyle |= WS_EX_TOPMOST;
+ Wnd->ExStyle |= WS_EX_TOPMOST;
}
else if (hWndPrev == HWND_TOP)
{
/* Link it after the last topmost window */
- PWINDOW_OBJECT WndInsertBefore;
+ PWND WndInsertBefore;
WndInsertBefore = Wnd->spwndParent->spwndChild;
- if (!(Wnd->Wnd->ExStyle & WS_EX_TOPMOST)) /* put it above the first non-topmost window */
+ if (!(Wnd->ExStyle & WS_EX_TOPMOST)) /* put it above the first non-topmost window */
{
while (WndInsertBefore != NULL && WndInsertBefore->spwndNext != NULL)
{
- if (!(WndInsertBefore->Wnd->ExStyle & WS_EX_TOPMOST)) break;
+ if (!(WndInsertBefore->ExStyle & WS_EX_TOPMOST)) break;
if (WndInsertBefore == Wnd->spwndOwner) /* keep it above owner */
{
- Wnd->Wnd->ExStyle |= WS_EX_TOPMOST;
+ Wnd->ExStyle |= WS_EX_TOPMOST;
break;
}
WndInsertBefore = WndInsertBefore->spwndNext;
else
{
/* Link it after hWndPrev */
- PWINDOW_OBJECT WndInsertAfter;
+ PWND WndInsertAfter;
WndInsertAfter = UserGetWindowObject(hWndPrev);
/* Are we called with an erroneous handle */
IntLinkWindow(Wnd, WndInsertAfter);
/* Fix the WS_EX_TOPMOST flag */
- if (!(WndInsertAfter->Wnd->ExStyle & WS_EX_TOPMOST))
+ if (!(WndInsertAfter->ExStyle & WS_EX_TOPMOST))
{
- Wnd->Wnd->ExStyle &= ~WS_EX_TOPMOST;
+ Wnd->ExStyle &= ~WS_EX_TOPMOST;
}
else
{
if(WndInsertAfter->spwndNext &&
- WndInsertAfter->spwndNext->Wnd->ExStyle & WS_EX_TOPMOST)
+ WndInsertAfter->spwndNext->ExStyle & WS_EX_TOPMOST)
{
- Wnd->Wnd->ExStyle |= WS_EX_TOPMOST;
+ Wnd->ExStyle |= WS_EX_TOPMOST;
}
}
}
HWND FASTCALL
IntSetOwner(HWND hWnd, HWND hWndNewOwner)
{
- PWINDOW_OBJECT Wnd, WndOldOwner, WndNewOwner;
+ PWND Wnd, WndOldOwner, WndNewOwner;
HWND ret;
Wnd = IntGetWindowObject(hWnd);
WndOldOwner = Wnd->spwndOwner;
- ret = WndOldOwner ? WndOldOwner->hSelf : 0;
+ ret = WndOldOwner ? WndOldOwner->head.h : 0;
if((WndNewOwner = UserGetWindowObject(hWndNewOwner)))
{
Wnd->spwndOwner= WndNewOwner;
- Wnd->Wnd->spwndOwner = WndNewOwner->Wnd;
}
else
{
Wnd->spwndOwner = NULL;
- Wnd->Wnd->spwndOwner = NULL;
}
UserDereferenceObject(Wnd);
return ret;
}
-PWINDOW_OBJECT FASTCALL
-co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
+PWND FASTCALL
+co_IntSetParent(PWND Wnd, PWND WndNewParent)
{
- PWINDOW_OBJECT WndOldParent;
+ PWND WndOldParent;
BOOL WasVisible;
ASSERT(Wnd);
WasVisible = co_WinPosShowWindow(Wnd, SW_HIDE);
/* Window must belong to current process */
- if (Wnd->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
+ if (Wnd->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
return NULL;
WndOldParent = Wnd->spwndParent;
/* Set the new parent */
Wnd->spwndParent = WndNewParent;
- Wnd->Wnd->spwndParent = WndNewParent->Wnd;
/* Link the window with its new siblings*/
IntLinkHwnd(Wnd, HWND_TOP);
* in the z-order and send the expected WM_WINDOWPOSCHANGING and
* WM_WINDOWPOSCHANGED notification messages.
*/
- co_WinPosSetWindowPos(Wnd, (0 == (Wnd->Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST),
+ co_WinPosSetWindowPos(Wnd, (0 == (Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST),
0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
| (WasVisible ? SWP_SHOWWINDOW : 0));
}
BOOL FASTCALL
-IntSetSystemMenu(PWINDOW_OBJECT Window, PMENU_OBJECT Menu)
+IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
{
PMENU_OBJECT OldMenu;
if(Window->SystemMenu)
/* unlink the window from siblings. children and parent are kept in place. */
VOID FASTCALL
-IntUnlinkWnd(PWND Wnd)
+IntUnlinkWindow(PWND Wnd)
{
if (Wnd->spwndNext)
- Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
-
- if (Wnd->spwndPrev)
- Wnd->spwndPrev->spwndNext = Wnd->spwndNext;
-
- if (Wnd->spwndParent && Wnd->spwndParent->spwndChild == Wnd)
- Wnd->spwndParent->spwndChild = Wnd->spwndNext;
-
- Wnd->spwndPrev = Wnd->spwndNext = NULL;
-}
-
-
-/* unlink the window from siblings. children and parent are kept in place. */
-VOID FASTCALL
-IntUnlinkWindow(PWINDOW_OBJECT Wnd)
-{
-
- IntUnlinkWnd(Wnd->Wnd);
-
- if (Wnd->spwndNext)
Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
- if (Wnd->spwndPrev)
+ if (Wnd->spwndPrev)
Wnd->spwndPrev->spwndNext = Wnd->spwndNext;
if (Wnd->spwndParent && Wnd->spwndParent->spwndChild == Wnd)
- Wnd->spwndParent->spwndChild = Wnd->spwndNext;
+ Wnd->spwndParent->spwndChild = Wnd->spwndNext;
Wnd->spwndPrev = Wnd->spwndNext = NULL;
}
BOOL FASTCALL
-IntIsWindowInDestroy(PWINDOW_OBJECT Window)
+IntIsWindowInDestroy(PWND Window)
{
- return ((Window->state & WINDOWSTATUS_DESTROYING) == WINDOWSTATUS_DESTROYING);
+ return ((Window->state2 & WNDS2_INDESTROY) == WNDS2_INDESTROY);
}
BOOL
FASTCALL
-IntGetWindowPlacement(PWINDOW_OBJECT Window, WINDOWPLACEMENT *lpwndpl)
+IntGetWindowPlacement(PWND Wnd, WINDOWPLACEMENT *lpwndpl)
{
- PWND Wnd;
POINT Size;
- Wnd = Window->Wnd;
if (!Wnd) return FALSE;
if(lpwndpl->length != sizeof(WINDOWPLACEMENT))
{
lpwndpl->showCmd = SW_HIDE;
}
- else if (0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
+ else if (0 != (Wnd->state2 & WNDS2_MAXIMIZEBUTTONDOWN) ||
0 != (Wnd->style & WS_MAXIMIZE))
{
lpwndpl->showCmd = SW_MAXIMIZE;
Size.x = Wnd->rcWindow.left;
Size.y = Wnd->rcWindow.top;
- WinPosInitInternalPos(Window, &Size,
+ WinPosInitInternalPos(Wnd, &Size,
&Wnd->rcWindow);
lpwndpl->rcNormalPosition = Wnd->InternalPos.NormalRect;
if (hwndParent || !dwThreadId)
{
PDESKTOP Desktop;
- PWINDOW_OBJECT Parent, Window;
+ PWND Parent, Window;
if(!hwndParent)
{
_SEH2_TRY
{
ProbeForWrite(pWnd, sizeof(HWND), 1);
- *pWnd = Window->hSelf;
+ *pWnd = Window->head.h;
pWnd++;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
PETHREAD Thread;
PTHREADINFO W32Thread;
PLIST_ENTRY Current;
- PWINDOW_OBJECT Window;
+ PWND Window;
Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread);
if(!NT_SUCCESS(Status))
Current = W32Thread->WindowListHead.Flink;
while(Current != &(W32Thread->WindowListHead))
{
- Window = CONTAINING_RECORD(Current, WINDOW_OBJECT, ThreadListEntry);
+ Window = CONTAINING_RECORD(Current, WND, ThreadListEntry);
ASSERT(Window);
if(bChildren || Window->spwndOwner != NULL)
{
if(dwCount < *pBufSize && pWnd)
{
- Status = MmCopyToCaller(pWnd++, &Window->hSelf, sizeof(HWND));
+ Status = MmCopyToCaller(pWnd++, &Window->head.h, sizeof(HWND));
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
LONG y,
UINT uiFlags)
{
- PWINDOW_OBJECT Parent;
+ PWND Parent;
POINTL Pt;
HWND Ret;
HWND *List, *phWnd;
Pt.x = x;
Pt.y = y;
- if(Parent->hSelf != IntGetDesktopWindow())
+ if(Parent->head.h != IntGetDesktopWindow())
{
- Pt.x += Parent->Wnd->rcClient.left;
- Pt.y += Parent->Wnd->rcClient.top;
+ Pt.x += Parent->rcClient.left;
+ Pt.y += Parent->rcClient.top;
}
if(!IntPtInWindow(Parent, Pt.x, Pt.y))
return NULL;
}
- Ret = Parent->hSelf;
+ Ret = Parent->head.h;
if((List = IntWinListChildren(Parent)))
{
for(phWnd = List; *phWnd; phWnd++)
{
- PWINDOW_OBJECT Child;
- PWND ChildWnd;
+ PWND Child;
if((Child = UserGetWindowObject(*phWnd)))
{
- ChildWnd = Child->Wnd;
- if(!(ChildWnd->style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE))
+ if(!(Child->style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE))
{
continue;
}
- if((ChildWnd->style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED))
+ if((Child->style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED))
{
continue;
}
- if((ChildWnd->ExStyle & WS_EX_TRANSPARENT) && (uiFlags & CWP_SKIPTRANSPARENT))
+ if((Child->ExStyle & WS_EX_TRANSPARENT) && (uiFlags & CWP_SKIPTRANSPARENT))
{
continue;
}
if(IntPtInWindow(Child, Pt.x, Pt.y))
{
- Ret = Child->hSelf;
+ Ret = Child->head.h;
break;
}
}
return Ret;
}
- static void IntSendParentNotify( PWINDOW_OBJECT pWindow, UINT msg )
- {
- if ( (pWindow->Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD &&
- !(pWindow->Wnd->style & WS_EX_NOPARENTNOTIFY))
- {
- if (pWindow->spwndParent && pWindow->spwndParent != UserGetDesktopWindow())
- {
- co_IntSendMessage( pWindow->spwndParent->hSelf,
- WM_PARENTNOTIFY,
- MAKEWPARAM( msg, pWindow->Wnd->IDMenu),
- (LPARAM)pWindow->hSelf );
- }
- }
- }
+static void IntSendParentNotify( PWND pWindow, UINT msg )
+{
+ if ( (pWindow->style & (WS_CHILD | WS_POPUP)) == WS_CHILD &&
+ !(pWindow->style & WS_EX_NOPARENTNOTIFY))
+ {
+ if (pWindow->spwndParent && pWindow->spwndParent != UserGetDesktopWindow())
+ {
+ co_IntSendMessage( pWindow->spwndParent->head.h,
+ WM_PARENTNOTIFY,
+ MAKEWPARAM( msg, pWindow->IDMenu),
+ (LPARAM)pWindow->head.h );
+ }
+ }
+}
void FASTCALL
-IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWINDOW_OBJECT ParentWindow, DWORD* dwShowMode)
+IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWND ParentWindow, DWORD* dwShowMode)
{
#define IS_DEFAULT(x) ((x) == CW_USEDEFAULT || (x) == (SHORT)0x8000)
}
/* Allocates and initializes a window*/
-PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
+PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
PLARGE_STRING WindowName,
PCLS Class,
- PWINDOW_OBJECT ParentWindow,
- PWINDOW_OBJECT OwnerWindow)
+ PWND ParentWindow,
+ PWND OwnerWindow)
{
- PWND Wnd = NULL;
- PWINDOW_OBJECT Window;
+ PWND pWnd = NULL;
HWND hWnd;
PTHREADINFO pti = NULL;
PMENU_OBJECT SystemMenu;
Cs->dwExStyle &= ~WS_EX_SETANSICREATOR;
/* Allocate the new window */
- Window = (PWINDOW_OBJECT) UserCreateObject( gHandleTable,
- pti->rpdesk,
- (PHANDLE)&hWnd,
- otWindow,
- sizeof(WINDOW_OBJECT));
- if (!Window)
- {
- goto AllocError;
- }
-
- Wnd = DesktopHeapAlloc(pti->rpdesk, sizeof(WND) + Class->cbwndExtra);
+ pWnd = (PWND) UserCreateObject( gHandleTable,
+ pti->rpdesk,
+ (PHANDLE)&hWnd,
+ otWindow,
+ sizeof(WND) + Class->cbwndExtra);
- if (!Wnd)
+ if (!pWnd)
{
goto AllocError;
}
- RtlZeroMemory(Wnd, sizeof(WND) + Class->cbwndExtra);
-
DPRINT("Created object with handle %X\n", hWnd);
if (NULL == pti->rpdesk->DesktopWindow)
{
/* If there is no desktop window yet, we must be creating it */
pti->rpdesk->DesktopWindow = hWnd;
- pti->rpdesk->pDeskInfo->spwnd = Wnd;
+ pti->rpdesk->pDeskInfo->spwnd = pWnd;
}
/*
* Fill out the structure describing it.
*/
- Window->Wnd = Wnd;
- Window->pti = pti;
- Window->hSelf = hWnd;
- Window->spwndParent = ParentWindow;
- Window->spwndOwner = OwnerWindow;
-
- Wnd->head.h = hWnd;
- Wnd->head.pti = pti;
- Wnd->head.rpdesk = pti->rpdesk;
- Wnd->fnid = 0;
- Wnd->hWndLastActive = hWnd;
- Wnd->state2 |= WNDS2_WIN40COMPAT;
- Wnd->pcls = Class;
- Wnd->hModule = Cs->hInstance;
- Wnd->style = Cs->style & ~WS_VISIBLE;
- Wnd->ExStyle = Cs->dwExStyle;
- Wnd->cbwndExtra = Wnd->pcls->cbwndExtra;
- Wnd->spwndOwner = OwnerWindow ? OwnerWindow->Wnd : NULL;
- Wnd->spwndParent = ParentWindow ? ParentWindow->Wnd : NULL;
-
- IntReferenceMessageQueue(Window->pti->MessageQueue);
- if (Wnd->spwndParent != NULL && Cs->hwndParent != 0)
- {
- Wnd->HideFocus = Wnd->spwndParent->HideFocus;
- Wnd->HideAccel = Wnd->spwndParent->HideAccel;
- }
-
- if (Wnd->pcls->CSF_flags & CSF_SERVERSIDEPROC)
- Wnd->state |= WNDS_SERVERSIDEWINDOWPROC;
+ /* Remember, pWnd->head is setup in object.c ...*/
+ pWnd->spwndParent = ParentWindow;
+ pWnd->spwndOwner = OwnerWindow;
+ pWnd->fnid = 0;
+ pWnd->hWndLastActive = hWnd;
+ pWnd->state2 |= WNDS2_WIN40COMPAT;
+ pWnd->pcls = Class;
+ pWnd->hModule = Cs->hInstance;
+ pWnd->style = Cs->style & ~WS_VISIBLE;
+ pWnd->ExStyle = Cs->dwExStyle;
+ pWnd->cbwndExtra = pWnd->pcls->cbwndExtra;
+
+ IntReferenceMessageQueue(pWnd->head.pti->MessageQueue);
+ if (pWnd->spwndParent != NULL && Cs->hwndParent != 0)
+ {
+ pWnd->HideFocus = pWnd->spwndParent->HideFocus;
+ pWnd->HideAccel = pWnd->spwndParent->HideAccel;
+ }
+
+ if (pWnd->pcls->CSF_flags & CSF_SERVERSIDEPROC)
+ pWnd->state |= WNDS_SERVERSIDEWINDOWPROC;
/* BugBoy Comments: Comment below say that System classes are always created
as UNICODE. In windows, creating a window with the ANSI version of CreateWindow
see what problems this would cause.*/
// Set WndProc from Class.
- Wnd->lpfnWndProc = Wnd->pcls->lpfnWndProc;
+ pWnd->lpfnWndProc = pWnd->pcls->lpfnWndProc;
// GetWindowProc, test for non server side default classes and set WndProc.
- if ( Wnd->pcls->fnid <= FNID_GHOST && Wnd->pcls->fnid >= FNID_BUTTON )
+ if ( pWnd->pcls->fnid <= FNID_GHOST && pWnd->pcls->fnid >= FNID_BUTTON )
{
if (bUnicodeWindow)
{
- if (GETPFNCLIENTA(Wnd->pcls->fnid) == Wnd->lpfnWndProc)
- Wnd->lpfnWndProc = GETPFNCLIENTW(Wnd->pcls->fnid);
+ if (GETPFNCLIENTA(pWnd->pcls->fnid) == pWnd->lpfnWndProc)
+ pWnd->lpfnWndProc = GETPFNCLIENTW(pWnd->pcls->fnid);
}
else
{
- if (GETPFNCLIENTW(Wnd->pcls->fnid) == Wnd->lpfnWndProc)
- Wnd->lpfnWndProc = GETPFNCLIENTA(Wnd->pcls->fnid);
+ if (GETPFNCLIENTW(pWnd->pcls->fnid) == pWnd->lpfnWndProc)
+ pWnd->lpfnWndProc = GETPFNCLIENTA(pWnd->pcls->fnid);
}
}
// If not an Unicode caller, set Ansi creator bit.
- if (!bUnicodeWindow) Wnd->state |= WNDS_ANSICREATOR;
+ if (!bUnicodeWindow) pWnd->state |= WNDS_ANSICREATOR;
// Clone Class Ansi/Unicode proc type.
- if (Wnd->pcls->CSF_flags & CSF_ANSIPROC)
+ if (pWnd->pcls->CSF_flags & CSF_ANSIPROC)
{
- Wnd->state |= WNDS_ANSIWINDOWPROC;
- Wnd->Unicode = FALSE;
+ pWnd->state |= WNDS_ANSIWINDOWPROC;
+ pWnd->Unicode = FALSE;
}
else
{ /*
Class->atomClassName == gpsi->atomSysClass[ICLS_MDICLIENT] ||
Class->atomClassName == gpsi->atomSysClass[ICLS_STATIC] ) )
{ // Override Class and set the window Ansi WndProc.
- Wnd->state |= WNDS_ANSIWINDOWPROC;
- Wnd->Unicode = FALSE;
+ pWnd->state |= WNDS_ANSIWINDOWPROC;
+ pWnd->Unicode = FALSE;
}
else
{ // Set the window Unicode WndProc.
- Wnd->state &= ~WNDS_ANSIWINDOWPROC;
- Wnd->Unicode = TRUE;
+ pWnd->state &= ~WNDS_ANSIWINDOWPROC;
+ pWnd->Unicode = TRUE;
}
}
if (Class->atomClassName == gpsi->atomSysClass[ICLS_EDIT])
{
PCALLPROCDATA CallProc;
- //CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, bUnicodeWindow, Wnd->ti->ppi);
- CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, Wnd->Unicode , Wnd->head.pti->ppi);
+ CallProc = CreateCallProc(NULL, pWnd->lpfnWndProc, pWnd->Unicode , pWnd->head.pti->ppi);
if (!CallProc)
{
}
else
{
- UserAddCallProcToClass(Wnd->pcls, CallProc);
+ UserAddCallProcToClass(pWnd->pcls, CallProc);
}
}
- InitializeListHead(&Wnd->PropListHead);
+ InitializeListHead(&pWnd->PropListHead);
if ( WindowName->Buffer != NULL && WindowName->Length > 0 )
{
- Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->head.rpdesk,
+ pWnd->strName.Buffer = DesktopHeapAlloc(pWnd->head.rpdesk,
WindowName->Length + sizeof(UNICODE_NULL));
- if (Wnd->strName.Buffer == NULL)
+ if (pWnd->strName.Buffer == NULL)
{
goto AllocError;
}
- RtlCopyMemory(Wnd->strName.Buffer, WindowName->Buffer, WindowName->Length);
- Wnd->strName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0';
- Wnd->strName.Length = WindowName->Length;
+ RtlCopyMemory(pWnd->strName.Buffer, WindowName->Buffer, WindowName->Length);
+ pWnd->strName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0';
+ pWnd->strName.Length = WindowName->Length;
}
/* Correct the window style. */
- if ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
+ if ((pWnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
{
- Wnd->style |= WS_CLIPSIBLINGS;
- if (!(Wnd->style & WS_POPUP))
+ pWnd->style |= WS_CLIPSIBLINGS;
+ if (!(pWnd->style & WS_POPUP))
{
- Wnd->style |= WS_CAPTION;
- Window->state |= WINDOWOBJECT_NEED_SIZE;
+ pWnd->style |= WS_CAPTION;
+ pWnd->state |= WNDS_SENDSIZEMOVEMSGS;
}
}
- if ((Wnd->ExStyle & WS_EX_DLGMODALFRAME) ||
- (Wnd->style & (WS_DLGFRAME | WS_THICKFRAME)))
- Wnd->ExStyle |= WS_EX_WINDOWEDGE;
+ if ((pWnd->ExStyle & WS_EX_DLGMODALFRAME) ||
+ (pWnd->style & (WS_DLGFRAME | WS_THICKFRAME)))
+ pWnd->ExStyle |= WS_EX_WINDOWEDGE;
else
- Wnd->ExStyle &= ~WS_EX_WINDOWEDGE;
+ pWnd->ExStyle &= ~WS_EX_WINDOWEDGE;
/* create system menu */
if((Cs->style & WS_SYSMENU) )//&& (dwStyle & WS_CAPTION) == WS_CAPTION)
{
- SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE);
+ SystemMenu = IntGetSystemMenu(pWnd, TRUE, TRUE);
if(SystemMenu)
{
- Window->SystemMenu = SystemMenu->MenuInfo.Self;
+ pWnd->SystemMenu = SystemMenu->MenuInfo.Self;
IntReleaseMenuObject(SystemMenu);
}
}
if ((Cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
{
if (Cs->hMenu)
- IntSetMenu(Window, Cs->hMenu, &MenuChanged);
- else if (Wnd->pcls->lpszMenuName) // Take it from the parent.
+ IntSetMenu(pWnd, Cs->hMenu, &MenuChanged);
+ else if (pWnd->pcls->lpszMenuName) // Take it from the parent.
{
UNICODE_STRING MenuName;
HMENU hMenu;
- if (IS_INTRESOURCE(Wnd->pcls->lpszMenuName))
+ if (IS_INTRESOURCE(pWnd->pcls->lpszMenuName))
{
MenuName.Length = 0;
MenuName.MaximumLength = 0;
- MenuName.Buffer = Wnd->pcls->lpszMenuName;
+ MenuName.Buffer = pWnd->pcls->lpszMenuName;
}
else
{
- RtlInitUnicodeString( &MenuName, Wnd->pcls->lpszMenuName);
+ RtlInitUnicodeString( &MenuName, pWnd->pcls->lpszMenuName);
}
- hMenu = co_IntCallLoadMenu( Wnd->pcls->hModule, &MenuName);
- if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
+ hMenu = co_IntCallLoadMenu( pWnd->pcls->hModule, &MenuName);
+ if (hMenu) IntSetMenu(pWnd, hMenu, &MenuChanged);
}
}
else // Not a child
- Wnd->IDMenu = (UINT) Cs->hMenu;
+ pWnd->IDMenu = (UINT) Cs->hMenu;
/* Insert the window into the thread's window list. */
- InsertTailList (&pti->WindowListHead, &Window->ThreadListEntry);
+ InsertTailList (&pti->WindowListHead, &pWnd->ThreadListEntry);
/* Handle "CS_CLASSDC", it is tested first. */
- if ( (Wnd->pcls->style & CS_CLASSDC) && !(Wnd->pcls->pdce) )
+ if ( (pWnd->pcls->style & CS_CLASSDC) && !(pWnd->pcls->pdce) )
{ /* One DCE per class to have CLASS. */
- Wnd->pcls->pdce = DceAllocDCE( Window, DCE_CLASS_DC );
+ pWnd->pcls->pdce = DceAllocDCE( pWnd, DCE_CLASS_DC );
}
- else if ( Wnd->pcls->style & CS_OWNDC)
+ else if ( pWnd->pcls->style & CS_OWNDC)
{ /* Allocate a DCE for this window. */
- DceAllocDCE(Window, DCE_WINDOW_DC);
+ DceAllocDCE(pWnd, DCE_WINDOW_DC);
}
- return Window;
+ return pWnd;
AllocError:
- if(Window)
- UserDereferenceObject(Window);
-
- if(Wnd)
- DesktopHeapFree(Wnd->head.rpdesk, Wnd);
+ if(pWnd)
+ UserDereferenceObject(pWnd);
SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
return NULL;
PUNICODE_STRING ClassName,
PLARGE_STRING WindowName)
{
- PWINDOW_OBJECT Window = NULL, ParentWindow = NULL, OwnerWindow;
+ PWND Window = NULL, ParentWindow = NULL, OwnerWindow;
HWND hWnd, hWndParent, hWndOwner;
DWORD dwStyle;
PWINSTATION_OBJECT WinSta;
- PWND Wnd = NULL;
PCLS Class = NULL;
SIZE Size;
POINT MaxPos;
RETURN(0);
}
- Wnd = Window->Wnd;
- hWnd = Window->hSelf;
+ hWnd = Window->head.h;
UserRefObjectCo(Window, &Ref);
ObDereferenceObject(WinSta);
/* Call the WH_CBT hook */
dwStyle = Cs->style;
- Cs->style = Wnd->style; /* HCBT_CREATEWND needs the real window style */
+ Cs->style = Window->style; /* HCBT_CREATEWND needs the real window style */
CbtCreate.lpcs = Cs;
CbtCreate.hwndInsertAfter = HWND_TOP;
if (ISITHOOKED(WH_CBT))
if (Size.cy < MinTrack.y) Size.cy = MinTrack.y;
}
- Wnd->rcWindow.left = Cs->x;
- Wnd->rcWindow.top = Cs->y;
- Wnd->rcWindow.right = Cs->x + Size.cx;
- Wnd->rcWindow.bottom = Cs->y + Size.cy;
- if (0 != (Wnd->style & WS_CHILD) && ParentWindow)
+ Window->rcWindow.left = Cs->x;
+ Window->rcWindow.top = Cs->y;
+ Window->rcWindow.right = Cs->x + Size.cx;
+ Window->rcWindow.bottom = Cs->y + Size.cy;
+ if (0 != (Window->style & WS_CHILD) && ParentWindow)
{
- RECTL_vOffsetRect(&Wnd->rcWindow,
- ParentWindow->Wnd->rcClient.left,
- ParentWindow->Wnd->rcClient.top);
+ RECTL_vOffsetRect(&Window->rcWindow,
+ ParentWindow->rcClient.left,
+ ParentWindow->rcClient.top);
}
- Wnd->rcClient = Wnd->rcWindow;
+ Window->rcClient = Window->rcWindow;
/* Link the window*/
}
/* Send the NCCREATE message */
- Result = co_IntSendMessage(Window->hSelf, WM_NCCREATE, 0, (LPARAM) Cs);
+ Result = co_IntSendMessage(Window->head.h, WM_NCCREATE, 0, (LPARAM) Cs);
if (!Result)
{
DPRINT1("co_UserCreateWindowEx(): NCCREATE message failed\n");
}
/* Send the WM_NCCALCSIZE message */
- MaxPos.x = Window->Wnd->rcWindow.left;
- MaxPos.y = Window->Wnd->rcWindow.top;
+ MaxPos.x = Window->rcWindow.left;
+ MaxPos.y = Window->rcWindow.top;
- Result = co_WinPosGetNonClientSize(Window, &Wnd->rcWindow, &Wnd->rcClient);
+ Result = co_WinPosGetNonClientSize(Window, &Window->rcWindow, &Window->rcClient);
- RECTL_vOffsetRect(&Wnd->rcWindow, MaxPos.x - Wnd->rcWindow.left,
- MaxPos.y - Wnd->rcWindow.top);
+ RECTL_vOffsetRect(&Window->rcWindow, MaxPos.x - Window->rcWindow.left,
+ MaxPos.y - Window->rcWindow.top);
/* Send the WM_CREATE message. */
- Result = co_IntSendMessage(Window->hSelf, WM_CREATE, 0, (LPARAM) Cs);
+ Result = co_IntSendMessage(Window->head.h, WM_CREATE, 0, (LPARAM) Cs);
if (Result == (LRESULT)-1)
{
DPRINT1("co_UserCreateWindowEx(): WM_CREATE message failed\n");
}
/* Send the EVENT_OBJECT_CREATE event*/
- IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window->Wnd, OBJID_WINDOW, 0);
+ IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_WINDOW, 0);
/* By setting the flag below it can be examined to determine if the window
was created successfully and a valid pwnd was passed back to caller since
from here the function has to succeed. */
- Window->Wnd->state2 |= WNDS2_WMCREATEMSGPROCESSED;
+ Window->state2 |= WNDS2_WMCREATEMSGPROCESSED;
/* Send the WM_SIZE and WM_MOVE messages. */
- if (!(Window->state & WINDOWOBJECT_NEED_SIZE))
+ if (!(Window->state & WNDS_SENDSIZEMOVEMSGS))
{
co_WinPosSendSizeMove(Window);
}
/* Show or maybe minimize or maximize the window. */
- if (Wnd->style & (WS_MINIMIZE | WS_MAXIMIZE))
+ if (Window->style & (WS_MINIMIZE | WS_MAXIMIZE))
{
RECTL NewPos;
UINT16 SwFlag;
- SwFlag = (Wnd->style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
+ SwFlag = (Window->style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
co_WinPosMinMaximize(Window, SwFlag, &NewPos);
- SwFlag = ((Wnd->style & WS_CHILD) || UserGetActiveWindow()) ?
+ SwFlag = ((Window->style & WS_CHILD) || UserGetActiveWindow()) ?
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED :
SWP_NOZORDER | SWP_FRAMECHANGED;
}
/* Initialize and show the window's scrollbars */
- if (Wnd->style & WS_VSCROLL)
+ if (Window->style & WS_VSCROLL)
{
co_UserShowScrollBar(Window, SB_VERT, TRUE);
}
- if (Wnd->style & WS_HSCROLL)
+ if (Window->style & WS_HSCROLL)
{
co_UserShowScrollBar(Window, SB_HORZ, TRUE);
}
/* Show the new window */
if (Cs->style & WS_VISIBLE)
{
- if (Wnd->style & WS_MAXIMIZE)
+ if (Window->style & WS_MAXIMIZE)
dwShowMode = SW_SHOW;
- else if (Wnd->style & WS_MINIMIZE)
+ else if (Window->style & WS_MINIMIZE)
dwShowMode = SW_SHOWMINIMIZED;
co_WinPosShowWindow(Window, dwShowMode);
- if (Wnd->ExStyle & WS_EX_MDICHILD)
+ if (Window->ExStyle & WS_EX_MDICHILD)
{
- co_IntSendMessage(ParentWindow->hSelf, WM_MDIREFRESHMENU, 0, 0);
+ co_IntSendMessage(ParentWindow->head.h, WM_MDIREFRESHMENU, 0, 0);
/* ShowWindow won't activate child windows */
co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
}
}
DPRINT("co_UserCreateWindowEx(): Created window %X\n", hWnd);
- RETURN( Wnd);
+ RETURN( Window);
CLEANUP:
if (!_ret_)
}
-BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
+BOOLEAN FASTCALL co_UserDestroyWindow(PWND Window)
{
- PWND Wnd;
HWND hWnd;
PTHREADINFO ti;
MSG msg;
ASSERT_REFS_CO(Window); // FIXME: temp hack?
- hWnd = Window->hSelf;
-
- Wnd = Window->Wnd;
-
- if (!Wnd) return TRUE; // FIXME: Need to finish object rewrite or lock the thread when killing the window!
+ hWnd = Window->head.h;
DPRINT("co_UserDestroyWindow \n");
/* Check for owner thread */
- if ( (Window->pti->pEThread != PsGetCurrentThread()) ||
- Wnd->head.pti != PsGetCurrentThreadWin32Thread() )
+ if ( (Window->head.pti->pEThread != PsGetCurrentThread()) ||
+ Window->head.pti != PsGetCurrentThreadWin32Thread() )
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
}
/* If window was created successfully and it is hooked */
- if ((Wnd->state2 & WNDS2_WMCREATEMSGPROCESSED) && (ISITHOOKED(WH_CBT)))
+ if ((Window->state2 & WNDS2_WMCREATEMSGPROCESSED) && (ISITHOOKED(WH_CBT)))
{
if (co_HOOK_CallHooks(WH_CBT, HCBT_DESTROYWND, (WPARAM) hWnd, 0)) return FALSE;
}
/* Inform the parent */
- if (Wnd->style & WS_CHILD)
+ if (Window->style & WS_CHILD)
{
IntSendParentNotify(Window, WM_DESTROY);
}
*/
if (!co_WinPosShowWindow(Window, SW_HIDE))
{
- if (UserGetActiveWindow() == Window->hSelf)
+ if (UserGetActiveWindow() == Window->head.h)
{
co_WinPosActivateOtherWindow(Window);
}
}
- if (Window->pti->MessageQueue->ActiveWindow == Window->hSelf)
- Window->pti->MessageQueue->ActiveWindow = NULL;
- if (Window->pti->MessageQueue->FocusWindow == Window->hSelf)
- Window->pti->MessageQueue->FocusWindow = NULL;
- if (Window->pti->MessageQueue->CaptureWindow == Window->hSelf)
- Window->pti->MessageQueue->CaptureWindow = NULL;
+ if (Window->head.pti->MessageQueue->ActiveWindow == Window->head.h)
+ Window->head.pti->MessageQueue->ActiveWindow = NULL;
+ if (Window->head.pti->MessageQueue->FocusWindow == Window->head.h)
+ Window->head.pti->MessageQueue->FocusWindow = NULL;
+ if (Window->head.pti->MessageQueue->CaptureWindow == Window->head.h)
+ Window->head.pti->MessageQueue->CaptureWindow = NULL;
/*
* Check if this window is the Shell's Desktop Window. If so set hShellWindow to NULL
}
}
- IntDereferenceMessageQueue(Window->pti->MessageQueue);
+ IntDereferenceMessageQueue(Window->head.pti->MessageQueue);
IntEngWindowChanged(Window, WOC_DELETE);
-
- if (!IntIsWindow(Window->hSelf))
+
+ if (!IntIsWindow(Window->head.h))
{
return TRUE;
}
/* Recursively destroy owned windows */
- if (! (Wnd->style & WS_CHILD))
+
+ if (! (Window->style & WS_CHILD))
{
for (;;)
{
BOOL GotOne = FALSE;
HWND *Children;
HWND *ChildHandle;
- PWINDOW_OBJECT Child, Desktop;
+ PWND Child, Desktop;
Desktop = IntIsDesktopWindow(Window) ? Window :
UserGetWindowObject(IntGetDesktopWindow());
if (Child->spwndOwner != NULL)
{
Child->spwndOwner = NULL;
- Child->Wnd->spwndOwner = NULL;
}
}
msg.pt = gpsi->ptCursor;
MsqInsertSystemMessage(&msg);
- if (!IntIsWindow(Window->hSelf))
+ if (!IntIsWindow(Window->head.h))
{
return TRUE;
}
BOOLEAN APIENTRY
NtUserDestroyWindow(HWND Wnd)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(BOOLEAN);
BOOLEAN ret;
USER_REFERENCE_ENTRY Ref;
static HWND FASTCALL
-IntFindWindow(PWINDOW_OBJECT Parent,
- PWINDOW_OBJECT ChildAfter,
+IntFindWindow(PWND Parent,
+ PWND ChildAfter,
RTL_ATOM ClassAtom,
PUNICODE_STRING WindowName)
{
if(ChildAfter)
{
/* skip handles before and including ChildAfter */
- while(*phWnd && (*(phWnd++) != ChildAfter->hSelf))
+ while(*phWnd && (*(phWnd++) != ChildAfter->head.h))
;
}
/* search children */
while(*phWnd)
{
- PWINDOW_OBJECT Child;
+ PWND Child;
if(!(Child = UserGetWindowObject(*(phWnd++))))
{
continue;
/* Do not send WM_GETTEXT messages in the kernel mode version!
The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */
- if (!ClassAtom || Child->Wnd->pcls->atomClassName == ClassAtom)
+ if (!ClassAtom || Child->pcls->atomClassName == ClassAtom)
{
// HACK: use UNICODE_STRING instead of LARGE_STRING
- CurrentWindowName.Buffer = Child->Wnd->strName.Buffer;
- CurrentWindowName.Length = Child->Wnd->strName.Length;
- CurrentWindowName.MaximumLength = Child->Wnd->strName.MaximumLength;
+ CurrentWindowName.Buffer = Child->strName.Buffer;
+ CurrentWindowName.Length = Child->strName.Length;
+ CurrentWindowName.MaximumLength = Child->strName.MaximumLength;
if(!CheckWindowName ||
- (Child->Wnd->strName.Length < 0xFFFF &&
+ (Child->strName.Length < 0xFFFF &&
!RtlCompareUnicodeString(WindowName, &CurrentWindowName, TRUE)))
{
- Ret = Child->hSelf;
+ Ret = Child->head.h;
break;
}
}
PUNICODE_STRING ucWindowName,
DWORD dwUnknown)
{
- PWINDOW_OBJECT Parent, ChildAfter;
+ PWND Parent, ChildAfter;
UNICODE_STRING ClassName = {0}, WindowName = {0};
HWND Desktop, Ret = NULL;
RTL_ATOM ClassAtom = (RTL_ATOM)0;
_SEH2_TRY
{
- if(Parent->hSelf == Desktop)
+ if(Parent->head.h == Desktop)
{
HWND *List, *phWnd;
- PWINDOW_OBJECT TopLevelWindow;
+ PWND TopLevelWindow;
BOOLEAN CheckWindowName;
BOOLEAN WindowMatches;
BOOLEAN ClassMatches;
if(ChildAfter)
{
/* skip handles before and including ChildAfter */
- while(*phWnd && (*(phWnd++) != ChildAfter->hSelf))
+ while(*phWnd && (*(phWnd++) != ChildAfter->head.h))
;
}
/* Do not send WM_GETTEXT messages in the kernel mode version!
The user mode version however calls GetWindowText() which will
send WM_GETTEXT messages to windows belonging to its processes */
- ustr.Buffer = TopLevelWindow->Wnd->strName.Buffer;
- ustr.Length = TopLevelWindow->Wnd->strName.Length;
- ustr.MaximumLength = TopLevelWindow->Wnd->strName.MaximumLength;
+ ustr.Buffer = TopLevelWindow->strName.Buffer;
+ ustr.Length = TopLevelWindow->strName.Length;
+ ustr.MaximumLength = TopLevelWindow->strName.MaximumLength;
WindowMatches = !CheckWindowName ||
- (TopLevelWindow->Wnd->strName.Length < 0xFFFF &&
+ (TopLevelWindow->strName.Length < 0xFFFF &&
!RtlCompareUnicodeString(&WindowName, &ustr, TRUE));
ClassMatches = (ClassAtom == (RTL_ATOM)0) ||
- ClassAtom == TopLevelWindow->Wnd->pcls->atomClassName;
+ ClassAtom == TopLevelWindow->pcls->atomClassName;
if (WindowMatches && ClassMatches)
{
- Ret = TopLevelWindow->hSelf;
+ Ret = TopLevelWindow->head.h;
break;
}
{
/* window returns the handle of the top-level window, in case it found
the child window */
- Ret = TopLevelWindow->hSelf;
+ Ret = TopLevelWindow->head.h;
break;
}
/* FIXME - if both hwndParent and hwndChildAfter are NULL, we also should
search the message-only windows. Should this also be done if
Parent is the desktop window??? */
- PWINDOW_OBJECT MsgWindows;
+ PWND MsgWindows;
if((MsgWindows = UserGetWindowObject(IntGetMessageWindow())))
{
/*
* @implemented
*/
-PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
+PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type)
{
- PWINDOW_OBJECT WndAncestor, Parent;
+ PWND WndAncestor, Parent;
- if (Wnd->hSelf == IntGetDesktopWindow())
+ if (Wnd->head.h == IntGetDesktopWindow())
{
return NULL;
}
for (;;)
{
- PWINDOW_OBJECT Parent;
+ PWND Parent;
Parent = IntGetParent(WndAncestor);
HWND APIENTRY
NtUserGetAncestor(HWND hWnd, UINT Type)
{
- PWINDOW_OBJECT Window, Ancestor;
+ PWND Window, Ancestor;
DECLARE_RETURN(HWND);
DPRINT("Enter NtUserGetAncestor\n");
Ancestor = UserGetAncestor(Window, Type);
/* faxme: can UserGetAncestor ever return NULL for a valid window? */
- RETURN(Ancestor ? Ancestor->hSelf : NULL);
+ RETURN(Ancestor ? Ancestor->head.h : NULL);
CLEANUP:
DPRINT("Leave NtUserGetAncestor, ret=%i\n",_ret_);
HWND hWnd,
PCOMBOBOXINFO pcbi)
{
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserGetComboBoxInfo\n");
_SEH2_END;
// Pass the user pointer, it was already probed.
- RETURN( (BOOL) co_IntSendMessage( Wnd->hSelf, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi));
+ RETURN( (BOOL) co_IntSendMessage( Wnd->head.h, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi));
CLEANUP:
DPRINT("Leave NtUserGetComboBoxInfo, ret=%i\n",_ret_);
LPRECT rectWnd,
LPPOINT ptIcon)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
DWORD Ret = 0;
BOOL Hit = FALSE;
WINDOWPLACEMENT wndpl;
UserEnterShared();
- if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if (!(Window = UserGetWindowObject(hWnd)))
{
Hit = FALSE;
goto Exit;
NtUserGetListBoxInfo(
HWND hWnd)
{
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
DECLARE_RETURN(DWORD);
DPRINT("Enter NtUserGetListBoxInfo\n");
RETURN( 0 );
}
- RETURN( (DWORD) co_IntSendMessage( Wnd->hSelf, LB_GETLISTBOXINFO, 0, 0 ));
+ RETURN( (DWORD) co_IntSendMessage( Wnd->head.h, LB_GETLISTBOXINFO, 0, 0 ));
CLEANUP:
DPRINT("Leave NtUserGetListBoxInfo, ret=%i\n",_ret_);
HWND FASTCALL
co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
{
- PWINDOW_OBJECT Wnd = NULL, WndParent = NULL, WndOldParent;
+ PWND Wnd = NULL, WndParent = NULL, WndOldParent;
HWND hWndOldParent = NULL;
USER_REFERENCE_ENTRY Ref, ParentRef;
if (WndOldParent)
{
- hWndOldParent = WndOldParent->hSelf;
+ hWndOldParent = WndOldParent->head.h;
UserDereferenceObject(WndOldParent);
}
NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
{
PWINSTATION_OBJECT WinStaObject;
- PWINDOW_OBJECT WndShell, WndListView;
+ PWND WndShell, WndListView;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
NTSTATUS Status;
co_WinPosSetWindowPos(hwndListView, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
#endif
- if (WndListView->Wnd->ExStyle & WS_EX_TOPMOST)
+ if (WndListView->ExStyle & WS_EX_TOPMOST)
{
ObDereferenceObject(WinStaObject);
RETURN( FALSE);
}
}
- if (WndShell->Wnd->ExStyle & WS_EX_TOPMOST)
+ if (WndShell->ExStyle & WS_EX_TOPMOST)
{
ObDereferenceObject(WinStaObject);
RETURN( FALSE);
HMENU APIENTRY
NtUserGetSystemMenu(HWND hWnd, BOOL bRevert)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PMENU_OBJECT Menu;
DECLARE_RETURN(HMENU);
NtUserSetSystemMenu(HWND hWnd, HMENU hMenu)
{
BOOL Result = FALSE;
- PWINDOW_OBJECT Window;
+ PWND Window;
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
LONG FASTCALL
co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
{
- PWINDOW_OBJECT Window, Parent;
- PWND Wnd;
+ PWND Window, Parent;
PWINSTATION_OBJECT WindowStation;
LONG OldValue;
STYLESTRUCT Style;
return( 0);
}
- Wnd = Window->Wnd;
-
- if (!Wnd) return 0; // No go on zero.
-
if ((INT)Index >= 0)
{
- if ((Index + sizeof(LONG)) > Wnd->cbwndExtra)
+ if ((Index + sizeof(LONG)) > Window->cbwndExtra)
{
SetLastWin32Error(ERROR_INVALID_INDEX);
return( 0);
}
- OldValue = *((LONG *)((PCHAR)(Wnd + 1) + Index));
+ OldValue = *((LONG *)((PCHAR)(Window + 1) + Index));
/*
if ( Index == DWLP_DLGPROC && Wnd->state & WNDS_DIALOGWINDOW)
{
if (!OldValue) return 0;
}
*/
- *((LONG *)((PCHAR)(Wnd + 1) + Index)) = NewValue;
+ *((LONG *)((PCHAR)(Window + 1) + Index)) = NewValue;
}
else
{
switch (Index)
{
case GWL_EXSTYLE:
- OldValue = (LONG) Wnd->ExStyle;
+ OldValue = (LONG) Window->ExStyle;
Style.styleOld = OldValue;
Style.styleNew = NewValue;
/*
* Remove extended window style bit WS_EX_TOPMOST for shell windows.
*/
- WindowStation = Window->pti->rpdesk->rpwinstaParent;
+ WindowStation = Window->head.pti->rpdesk->rpwinstaParent;
if(WindowStation)
{
if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView)
}
co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_EXSTYLE, (LPARAM) &Style);
- Wnd->ExStyle = (DWORD)Style.styleNew;
+ Window->ExStyle = (DWORD)Style.styleNew;
co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_EXSTYLE, (LPARAM) &Style);
break;
case GWL_STYLE:
- OldValue = (LONG) Wnd->style;
+ OldValue = (LONG) Window->style;
Style.styleOld = OldValue;
Style.styleNew = NewValue;
co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style);
- Wnd->style = (DWORD)Style.styleNew;
+ Window->style = (DWORD)Style.styleNew;
co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM) &Style);
break;
case GWL_WNDPROC:
{
- if ( Wnd->head.pti->ppi != PsGetCurrentProcessWin32Process() ||
- Wnd->fnid & FNID_FREED)
+ if ( Window->head.pti->ppi != PsGetCurrentProcessWin32Process() ||
+ Window->fnid & FNID_FREED)
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return( 0);
}
- OldValue = (LONG)IntSetWindowProc(Wnd,
+ OldValue = (LONG)IntSetWindowProc(Window,
(WNDPROC)NewValue,
Ansi);
break;
}
case GWL_HINSTANCE:
- OldValue = (LONG) Wnd->hModule;
- Wnd->hModule = (HINSTANCE) NewValue;
+ OldValue = (LONG) Window->hModule;
+ Window->hModule = (HINSTANCE) NewValue;
break;
case GWL_HWNDPARENT:
Parent = Window->spwndParent;
- if (Parent && (Parent->hSelf == IntGetDesktopWindow()))
- OldValue = (LONG) IntSetOwner(Window->hSelf, (HWND) NewValue);
+ if (Parent && (Parent->head.h == IntGetDesktopWindow()))
+ OldValue = (LONG) IntSetOwner(Window->head.h, (HWND) NewValue);
else
- OldValue = (LONG) co_UserSetParent(Window->hSelf, (HWND) NewValue);
+ OldValue = (LONG) co_UserSetParent(Window->head.h, (HWND) NewValue);
break;
case GWL_ID:
- OldValue = (LONG) Wnd->IDMenu;
- Wnd->IDMenu = (UINT) NewValue;
+ OldValue = (LONG) Window->IDMenu;
+ Window->IDMenu = (UINT) NewValue;
break;
case GWL_USERDATA:
- OldValue = Wnd->dwUserData;
- Wnd->dwUserData = NewValue;
+ OldValue = Window->dwUserData;
+ Window->dwUserData = NewValue;
break;
default:
WORD APIENTRY
NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
WORD OldValue;
DECLARE_RETURN(WORD);
case GWL_ID:
case GWL_HINSTANCE:
case GWL_HWNDPARENT:
- RETURN( co_UserSetWindowLong(Window->hSelf, Index, (UINT)NewValue, TRUE));
+ RETURN( co_UserSetWindowLong(Window->head.h, Index, (UINT)NewValue, TRUE));
default:
if (Index < 0)
{
}
}
- if (Index > Window->Wnd->cbwndExtra - sizeof(WORD))
+ if (Index > Window->cbwndExtra - sizeof(WORD))
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
RETURN( 0);
}
- OldValue = *((WORD *)((PCHAR)(Window->Wnd + 1) + Index));
- *((WORD *)((PCHAR)(Window->Wnd + 1) + Index)) = NewValue;
+ OldValue = *((WORD *)((PCHAR)(Window + 1) + Index));
+ *((WORD *)((PCHAR)(Window + 1) + Index)) = NewValue;
RETURN( OldValue);
NtUserGetWindowPlacement(HWND hWnd,
WINDOWPLACEMENT *lpwndpl)
{
- PWINDOW_OBJECT Window;
PWND Wnd;
POINT Size;
WINDOWPLACEMENT Safepl;
DPRINT("Enter NtUserGetWindowPlacement\n");
UserEnterShared();
- if (!(Window = UserGetWindowObject(hWnd)))
+ if (!(Wnd = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
}
- Wnd = Window->Wnd;
Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
if(!NT_SUCCESS(Status))
{
Safepl.showCmd = SW_HIDE;
}
- else if ((0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
+ else if ((0 != (Wnd->state2 & WNDS2_MAXIMIZEBUTTONDOWN) ||
0 != (Wnd->style & WS_MAXIMIZE)) &&
0 == (Wnd->style & WS_MINIMIZE))
{
Size.x = Wnd->rcWindow.left;
Size.y = Wnd->rcWindow.top;
- WinPosInitInternalPos(Window, &Size,
+ WinPosInitInternalPos(Wnd, &Size,
&Wnd->rcWindow);
Safepl.rcNormalPosition = Wnd->InternalPos.NormalRect;
DWORD APIENTRY
NtUserQueryWindow(HWND hWnd, DWORD Index)
{
- PWINDOW_OBJECT Window;
PWND pWnd;
DWORD Result;
DECLARE_RETURN(UINT);
DPRINT("Enter NtUserQueryWindow\n");
UserEnterShared();
- if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if (!(pWnd = UserGetWindowObject(hWnd)))
{
RETURN( 0);
}
- pWnd = Window->Wnd;
-
switch(Index)
{
case QUERY_WINDOW_UNIQUE_PROCESS_ID:
- Result = (DWORD)IntGetWndProcessId(Window);
+ Result = (DWORD)IntGetWndProcessId(pWnd);
break;
case QUERY_WINDOW_UNIQUE_THREAD_ID:
- Result = (DWORD)IntGetWndThreadId(Window);
+ Result = (DWORD)IntGetWndThreadId(pWnd);
break;
case QUERY_WINDOW_ACTIVE:
break;
case QUERY_WINDOW_ISHUNG:
- Result = (DWORD)MsqIsHung(Window->pti->MessageQueue);
+ Result = (DWORD)MsqIsHung(pWnd->head.pti->MessageQueue);
break;
case QUERY_WINDOW_REAL_ID:
HMENU Menu,
BOOL Repaint)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL Changed;
DECLARE_RETURN(BOOL);
NtUserSetWindowFNID(HWND hWnd,
WORD fnID)
{
- PWINDOW_OBJECT Window;
PWND Wnd;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetWindowFNID\n");
UserEnterExclusive();
- if (!(Window = UserGetWindowObject(hWnd)))
+ if (!(Wnd = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
}
- Wnd = Window->Wnd;
if (Wnd->pcls)
{ // From user land we only set these.
NtUserSetWindowPlacement(HWND hWnd,
WINDOWPLACEMENT *lpwndpl)
{
- PWINDOW_OBJECT Window;
PWND Wnd;
WINDOWPLACEMENT Safepl;
NTSTATUS Status;
DPRINT("Enter NtUserSetWindowPlacement\n");
UserEnterExclusive();
- if (!(Window = UserGetWindowObject(hWnd)))
+ if (!(Wnd = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
}
- Wnd = Window->Wnd;
Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
if(!NT_SUCCESS(Status))
RETURN( FALSE);
}
- UserRefObjectCo(Window, &Ref);
+ UserRefObjectCo(Wnd, &Ref);
if ((Wnd->style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0)
{
- co_WinPosSetWindowPos(Window, NULL,
+ co_WinPosSetWindowPos(Wnd, NULL,
Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.top,
Safepl.rcNormalPosition.right - Safepl.rcNormalPosition.left,
Safepl.rcNormalPosition.bottom - Safepl.rcNormalPosition.top,
}
/* FIXME - change window status */
- co_WinPosShowWindow(Window, Safepl.showCmd);
+ co_WinPosShowWindow(Wnd, Safepl.showCmd);
Wnd->InternalPosInitialized = TRUE;
Wnd->InternalPos.NormalRect = Safepl.rcNormalPosition;
Wnd->InternalPos.IconPos = Safepl.ptMinPosition;
Wnd->InternalPos.MaxPos = Safepl.ptMaxPosition;
- UserDerefObjectCo(Window);
+ UserDerefObjectCo(Wnd);
RETURN(TRUE);
CLEANUP:
UINT uFlags)
{
DECLARE_RETURN(BOOL);
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL ret;
USER_REFERENCE_ENTRY Ref;
INT FASTCALL
-IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn)
+IntGetWindowRgn(PWND Window, HRGN hRgn)
{
INT Ret;
HRGN VisRgn;
ROSRGNDATA *pRgn;
- PWND Wnd;
if(!Window)
{
return ERROR;
}
- Wnd = Window->Wnd;
-
/* Create a new window region using the window rectangle */
- VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
- NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+ VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
+ NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top);
/* if there's a region assigned to the window, combine them both */
- if(Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
+ if(Window->hrgnClip && !(Window->style & WS_MINIMIZE))
NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
/* Copy the region into hRgn */
NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY);
}
INT FASTCALL
-IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect)
+IntGetWindowRgnBox(PWND Window, RECTL *Rect)
{
INT Ret;
HRGN VisRgn;
ROSRGNDATA *pRgn;
- PWND Wnd;
if(!Window)
{
return ERROR;
}
- Wnd = Window->Wnd;
-
/* Create a new window region using the window rectangle */
- VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
- NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+ VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
+ NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top);
/* if there's a region assigned to the window, combine them both */
- if(Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
+ if(Window->hrgnClip && !(Window->style & WS_MINIMIZE))
NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
if((pRgn = RGNOBJAPI_Lock(VisRgn, NULL)))
BOOL bRedraw)
{
HRGN hrgnCopy;
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(INT);
DPRINT("Enter NtUserSetWindowRgn\n");
BOOL APIENTRY
NtUserShowWindow(HWND hWnd, LONG nCmdShow)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
BOOL ret;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
{
POINT pt;
HWND Ret;
- PWINDOW_OBJECT DesktopWindow = NULL, Window = NULL;
+ PWND DesktopWindow = NULL, Window = NULL;
DECLARE_RETURN(HWND);
USER_REFERENCE_ENTRY Ref;
if(Window)
{
- Ret = Window->hSelf;
+ Ret = Window->head.h;
RETURN( Ret);
}
BOOL APIENTRY
NtUserDefSetText(HWND hWnd, PLARGE_STRING WindowText)
{
- PWINDOW_OBJECT Window;
PWND Wnd;
LARGE_STRING SafeText;
UNICODE_STRING UnicodeString;
UserEnterExclusive();
- if(!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ if(!(Wnd = UserGetWindowObject(hWnd)))
{
UserLeave();
return FALSE;
}
- Wnd = Window->Wnd;
// ReactOS uses Unicode and not mixed. Up/Down converting will take time.
// Brought to you by: The Wine Project! Dysfunctional Thought Processes!
// In User32, these are called after: NotifyWinEvent EVENT_OBJECT_NAMECHANGE than
// RepaintButton, StaticRepaint, NtUserCallHwndLock HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK, etc.
/* Send shell notifications */
- if (!Window->spwndOwner && !IntGetParent(Window))
+ if (!Wnd->spwndOwner && !IntGetParent(Wnd))
{
co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) hWnd);
}
INT APIENTRY
NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
{
- PWINDOW_OBJECT Window;
PWND Wnd;
NTSTATUS Status;
INT Result;
RETURN( 0);
}
- if(!(Window = UserGetWindowObject(hWnd)))
+ if(!(Wnd = UserGetWindowObject(hWnd)))
{
RETURN( 0);
}
- Wnd = Window->Wnd;
Result = Wnd->strName.Length / sizeof(WCHAR);
if(lpString)
BOOL
FASTCALL
-IntShowOwnedPopups(PWINDOW_OBJECT OwnerWnd, BOOL fShow )
+IntShowOwnedPopups(PWND OwnerWnd, BOOL fShow )
{
int count = 0;
- PWINDOW_OBJECT pWnd;
+ PWND pWnd;
HWND *win_array;
// ASSERT(OwnerWnd);
if (fShow)
{
- if (pWnd->Wnd->state & WNDS_HIDDENPOPUP)
+ if (pWnd->state & WNDS_HIDDENPOPUP)
{
/* In Windows, ShowOwnedPopups(TRUE) generates
* WM_SHOWWINDOW messages with SW_PARENTOPENING,
}
else
{
- if (pWnd->Wnd->style & WS_VISIBLE)
+ if (pWnd->style & WS_VISIBLE)
{
/* In Windows, ShowOwnedPopups(FALSE) generates
* WM_SHOWWINDOW messages with SW_PARENTCLOSING,
{
case otWindow:
{
- PWINDOW_OBJECT Window;
+ PWND Window;
if ((Window = UserGetWindowObject((HWND) handle))) return TRUE;
return FALSE;
}
#include <debug.h>
VOID FASTCALL
-co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse);
+co_IntPaintWindows(PWND Window, ULONG Flags, BOOL Recurse);
BOOL FASTCALL
-IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse);
+IntValidateParent(PWND Child, HRGN hValidateRgn, BOOL Recurse);
/* GLOBALS *******************************************************************/
/* FUNCTIONS *****************************************************************/
BOOL FASTCALL
-IntGetClientOrigin(PWINDOW_OBJECT Window OPTIONAL, LPPOINT Point)
+IntGetClientOrigin(PWND Window OPTIONAL, LPPOINT Point)
{
Window = Window ? Window : UserGetWindowObject(IntGetDesktopWindow());
if (Window == NULL)
Point->x = Point->y = 0;
return FALSE;
}
- Point->x = Window->Wnd->rcClient.left;
- Point->y = Window->Wnd->rcClient.top;
+ Point->x = Window->rcClient.left;
+ Point->y = Window->rcClient.top;
return TRUE;
}
BOOL FASTCALL
-UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point)
+UserGetClientOrigin(PWND Window, LPPOINT Point)
{
BOOL Ret;
POINT pt;
* Check if we can activate the specified window.
*/
static
-BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL)
+BOOL FASTCALL can_activate_window( PWND Wnd OPTIONAL)
{
LONG style;
if (!Wnd) return FALSE;
- if (!Wnd->Wnd) return FALSE;
- style = Wnd->Wnd->style;
+
+ style = Wnd->style;
if (!(style & WS_VISIBLE) &&
- Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
+ Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
if ((style & WS_MINIMIZE) &&
- Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
+ Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
return TRUE;
/* FIXME: This window could be disable because the child that closed
* Activates window other than pWnd.
*/
VOID FASTCALL
-co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
+co_WinPosActivateOtherWindow(PWND Wnd)
{
- PWINDOW_OBJECT WndTo = NULL;
+ PWND WndTo = NULL;
HWND Fg;
USER_REFERENCE_ENTRY Ref;
- PWND Wnd;
-
- ASSERT_REFS_CO(Window);
- Wnd = Window->Wnd;
+ ASSERT_REFS_CO(Wnd);
- if (IntIsDesktopWindow(Window))
+ if (IntIsDesktopWindow(Wnd))
{
IntSetFocusMessageQueue(NULL);
return;
}
/* If this is popup window, try to activate the owner first. */
- if ((Wnd->style & WS_POPUP) && (WndTo = Window->spwndOwner))
+ if ((Wnd->style & WS_POPUP) && (WndTo = Wnd->spwndOwner))
{
WndTo = UserGetAncestor( WndTo, GA_ROOT );
if (can_activate_window(WndTo)) goto done;
/* Pick a next top-level window. */
/* FIXME: Search for non-tooltip windows first. */
- WndTo = Window;
+ WndTo = Wnd;
for (;;)
{
if (!(WndTo = WndTo->spwndNext)) break;
if (WndTo) UserRefObjectCo(WndTo, &Ref);
Fg = UserGetForegroundWindow();
- if ((!Fg || Window->hSelf == Fg) && WndTo)//fixme: ok if WndTo is NULL??
+ if ((!Fg || Wnd->head.h == Fg) && WndTo)//fixme: ok if WndTo is NULL??
{
/* fixme: wine can pass WndTo=NULL to co_IntSetForegroundWindow. hmm */
if (co_IntSetForegroundWindow(WndTo))
UINT
FASTCALL
-co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
+co_WinPosArrangeIconicWindows(PWND parent)
{
RECTL rectParent;
INT i, x, y, xspacing, yspacing;
for( i = 0; List[i]; i++)
{
- PWINDOW_OBJECT WndChild;
- PWND ChildWnd;
+ PWND Child;
- if (!(WndChild = UserGetWindowObject(List[i])))
+ if (!(Child = UserGetWindowObject(List[i])))
continue;
- ChildWnd = WndChild->Wnd;
-
- if((ChildWnd->style & WS_MINIMIZE) != 0 )
+ if((Child->style & WS_MINIMIZE) != 0 )
{
USER_REFERENCE_ENTRY Ref;
- UserRefObjectCo(WndChild, &Ref);
+ UserRefObjectCo(Child, &Ref);
- co_WinPosSetWindowPos(WndChild, 0, x + UserGetSystemMetrics(SM_CXBORDER),
+ co_WinPosSetWindowPos(Child, 0, x + UserGetSystemMetrics(SM_CXBORDER),
y - yspacing - UserGetSystemMetrics(SM_CYBORDER)
, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
- UserDerefObjectCo(WndChild);
+ UserDerefObjectCo(Child);
if (x <= rectParent.right - xspacing)
x += xspacing;
static VOID FASTCALL
-WinPosFindIconPos(PWINDOW_OBJECT Window, POINT *Pos)
+WinPosFindIconPos(PWND Window, POINT *Pos)
{
/* FIXME */
}
VOID FASTCALL
-WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
+WinPosInitInternalPos(PWND Wnd, POINT *pt, RECTL *RestoreRect)
{
- PWINDOW_OBJECT Parent;
+ PWND Parent;
UINT XInc, YInc;
- PWND Wnd = Window->Wnd;
if (!Wnd->InternalPosInitialized)
{
RECTL WorkArea;
- Parent = Window->spwndParent;
+ Parent = Wnd->spwndParent;
if(Parent)
{
if(IntIsDesktopWindow(Parent))
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
else
- WorkArea = Parent->Wnd->rcClient;
+ WorkArea = Parent->rcClient;
}
else
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
- Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow;
- IntGetWindowBorderMeasures(Window, &XInc, &YInc);
+ Wnd->InternalPos.NormalRect = Wnd->rcWindow;
+ IntGetWindowBorderMeasures(Wnd, &XInc, &YInc);
Wnd->InternalPos.MaxPos.x = WorkArea.left - XInc;
Wnd->InternalPos.MaxPos.y = WorkArea.top - YInc;
Wnd->InternalPos.IconPos.x = WorkArea.left;
}
UINT FASTCALL
-co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
+co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos)
{
POINT Size;
UINT SwpFlags = 0;
- PWND Wnd;
- ASSERT_REFS_CO(Window);
- Wnd = Window->Wnd;
+ ASSERT_REFS_CO(Wnd);
Size.x = Wnd->rcWindow.left;
Size.y = Wnd->rcWindow.top;
- WinPosInitInternalPos(Window, &Size, &Wnd->rcWindow);
+ WinPosInitInternalPos(Wnd, &Size, &Wnd->rcWindow);
- if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Window->hSelf, ShowFlag))
+ if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Wnd->head.h, ShowFlag))
return SWP_NOSIZE | SWP_NOMOVE;
if (Wnd->style & WS_MINIMIZE)
{
- if (!co_IntSendMessageNoWait(Window->hSelf, WM_QUERYOPEN, 0, 0))
+ if (!co_IntSendMessageNoWait(Wnd->head.h, WM_QUERYOPEN, 0, 0))
{
return(SWP_NOSIZE | SWP_NOMOVE);
}
{
if (Wnd->style & WS_MAXIMIZE)
{
- Window->state |= WINDOWOBJECT_RESTOREMAX;
+ Wnd->state2 |= WNDS2_MAXIMIZEBUTTONDOWN;
Wnd->style &= ~WS_MAXIMIZE;
}
else
{
- Window->state &= ~WINDOWOBJECT_RESTOREMAX;
+ Wnd->state2 &= ~WNDS2_MAXIMIZEBUTTONDOWN;
}
- co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
+ co_UserRedrawWindow(Wnd, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
RDW_NOINTERNALPAINT);
Wnd->style |= WS_MINIMIZE;
- WinPosFindIconPos(Window, &Wnd->InternalPos.IconPos);
+ WinPosFindIconPos(Wnd, &Wnd->InternalPos.IconPos);
RECTL_vSetRect(NewPos, Wnd->InternalPos.IconPos.x, Wnd->InternalPos.IconPos.y,
UserGetSystemMetrics(SM_CXMINIMIZED),
UserGetSystemMetrics(SM_CYMINIMIZED));
case SW_MAXIMIZE:
{
- co_WinPosGetMinMaxInfo(Window, &Size, &Wnd->InternalPos.MaxPos,
+ co_WinPosGetMinMaxInfo(Wnd, &Size, &Wnd->InternalPos.MaxPos,
NULL, NULL);
DPRINT("Maximize: %d,%d %dx%d\n",
Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y, Size.x, Size.y);
if (Wnd->style & WS_MINIMIZE)
{
Wnd->style &= ~WS_MINIMIZE;
- if (Window->state & WINDOWOBJECT_RESTOREMAX)
+ if (Wnd->state2 & WNDS2_MAXIMIZEBUTTONDOWN)
{
- co_WinPosGetMinMaxInfo(Window, &Size,
+ co_WinPosGetMinMaxInfo(Wnd, &Size,
&Wnd->InternalPos.MaxPos, NULL, NULL);
Wnd->style |= WS_MAXIMIZE;
RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x,
}
UINT FASTCALL
-co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
+co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos,
POINT* MinTrack, POINT* MaxTrack)
{
MINMAXINFO MinMax;
PMONITOR monitor;
INT xinc, yinc;
- LONG style = Window->Wnd->style;
+ LONG style = Window->style;
LONG adjustedStyle;
- LONG exstyle = Window->Wnd->ExStyle;
+ LONG exstyle = Window->ExStyle;
RECT rc;
ASSERT_REFS_CO(Window);
/* Compute default values */
- rc = Window->Wnd->rcWindow;
+ rc = Window->rcWindow;
MinMax.ptReserved.x = rc.left;
MinMax.ptReserved.y = rc.top;
else
adjustedStyle = style;
- if(Window->Wnd->spwndParent)
+ if(Window->spwndParent)
IntGetClientRect(Window->spwndParent, &rc);
- UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->Wnd->IDMenu), exstyle);
+ UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->IDMenu), exstyle);
xinc = -rc.left;
yinc = -rc.top;
//if (!EMPTYPOINT(win->max_pos)) MinMax.ptMaxPosition = win->max_pos;
- co_IntSendMessage(Window->hSelf, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
+ co_IntSendMessage(Window->head.h, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
/* if the app didn't change the values, adapt them for the current monitor */
if ((monitor = IntGetPrimaryMonitor()))
static
LONG FASTCALL
-co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
+co_WinPosDoNCCALCSize(PWND Window, PWINDOWPOS WinPos,
RECT* WindowRect, RECT* ClientRect)
{
- PWINDOW_OBJECT Parent;
+ PWND Parent;
UINT wvrFlags = 0;
- PWND Wnd;
ASSERT_REFS_CO(Window);
- Wnd = Window->Wnd;
/* Send WM_NCCALCSIZE message to get new client area */
if ((WinPos->flags & (SWP_FRAMECHANGED | SWP_NOSIZE)) != SWP_NOSIZE)
WINDOWPOS winposCopy;
params.rgrc[0] = *WindowRect;
- params.rgrc[1] = Window->Wnd->rcWindow;
- params.rgrc[2] = Window->Wnd->rcClient;
+ params.rgrc[1] = Window->rcWindow;
+ params.rgrc[2] = Window->rcClient;
Parent = Window->spwndParent;
- if (0 != (Wnd->style & WS_CHILD) && Parent)
+ if (0 != (Window->style & WS_CHILD) && Parent)
{
- RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->Wnd->rcClient.left,
- - Parent->Wnd->rcClient.top);
- RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->Wnd->rcClient.left,
- - Parent->Wnd->rcClient.top);
- RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->Wnd->rcClient.left,
- - Parent->Wnd->rcClient.top);
+ RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->rcClient.left,
+ - Parent->rcClient.top);
+ RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->rcClient.left,
+ - Parent->rcClient.top);
+ RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->rcClient.left,
+ - Parent->rcClient.top);
}
params.lppos = &winposCopy;
winposCopy = *WinPos;
- wvrFlags = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms);
+ wvrFlags = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms);
/* If the application send back garbage, ignore it */
if (params.rgrc[0].left <= params.rgrc[0].right &&
params.rgrc[0].top <= params.rgrc[0].bottom)
{
*ClientRect = params.rgrc[0];
- if ((Wnd->style & WS_CHILD) && Parent)
+ if ((Window->style & WS_CHILD) && Parent)
{
- RECTL_vOffsetRect(ClientRect, Parent->Wnd->rcClient.left,
- Parent->Wnd->rcClient.top);
+ RECTL_vOffsetRect(ClientRect, Parent->rcClient.left,
+ Parent->rcClient.top);
}
FixClientRect(ClientRect, WindowRect);
}
/* FIXME: WVR_ALIGNxxx */
- if (ClientRect->left != Wnd->rcClient.left ||
- ClientRect->top != Wnd->rcClient.top)
+ if (ClientRect->left != Window->rcClient.left ||
+ ClientRect->top != Window->rcClient.top)
{
WinPos->flags &= ~SWP_NOCLIENTMOVE;
}
if ((ClientRect->right - ClientRect->left !=
- Wnd->rcClient.right - Wnd->rcClient.left) ||
+ Window->rcClient.right - Window->rcClient.left) ||
(ClientRect->bottom - ClientRect->top !=
- Wnd->rcClient.bottom - Wnd->rcClient.top))
+ Window->rcClient.bottom - Window->rcClient.top))
{
WinPos->flags &= ~SWP_NOCLIENTSIZE;
}
else
{
if (! (WinPos->flags & SWP_NOMOVE)
- && (ClientRect->left != Wnd->rcClient.left ||
- ClientRect->top != Wnd->rcClient.top))
+ && (ClientRect->left != Window->rcClient.left ||
+ ClientRect->top != Window->rcClient.top))
{
WinPos->flags &= ~SWP_NOCLIENTMOVE;
}
static
BOOL FASTCALL
-co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
+co_WinPosDoWinPosChanging(PWND Window,
PWINDOWPOS WinPos,
PRECTL WindowRect,
PRECTL ClientRect)
{
INT X, Y;
- PWND Wnd;
ASSERT_REFS_CO(Window);
- Wnd = Window->Wnd;
if (!(WinPos->flags & SWP_NOSENDCHANGING))
{
- co_IntSendMessageNoWait(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
+ co_IntSendMessageNoWait(Window->head.h, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
}
- *WindowRect = Wnd->rcWindow;
- *ClientRect = Wnd->rcClient;
+ *WindowRect = Window->rcWindow;
+ *ClientRect = Window->rcClient;
if (!(WinPos->flags & SWP_NOSIZE))
{
if (!(WinPos->flags & SWP_NOMOVE))
{
- PWINDOW_OBJECT Parent;
+ PWND Parent;
X = WinPos->x;
Y = WinPos->y;
Parent = Window->spwndParent;
- if ((0 != (Wnd->style & WS_CHILD)) && Parent)
+ if ((0 != (Window->style & WS_CHILD)) && Parent)
{
- X += Parent->Wnd->rcClient.left;
- Y += Parent->Wnd->rcClient.top;
+ X += Parent->rcClient.left;
+ Y += Parent->rcClient.top;
}
WindowRect->left = X;
WindowRect->top = Y;
- WindowRect->right += X - Wnd->rcWindow.left;
- WindowRect->bottom += Y - Wnd->rcWindow.top;
+ WindowRect->right += X - Window->rcWindow.left;
+ WindowRect->bottom += Y - Window->rcWindow.top;
RECTL_vOffsetRect(ClientRect,
- X - Wnd->rcWindow.left,
- Y - Wnd->rcWindow.top);
+ X - Window->rcWindow.left,
+ Y - Window->rcWindow.top);
}
WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE;
HWND *List = NULL;
HWND Owner;
LONG Style;
- PWINDOW_OBJECT Window ,DesktopWindow, ChildObject;
+ PWND Window ,DesktopWindow, ChildObject;
int i;
Window = UserGetWindowObject(hWnd);
- Owner = Window->spwndOwner ? Window->spwndOwner->hSelf : NULL;
- Style = Window->Wnd->style;
+ Owner = Window->spwndOwner ? Window->spwndOwner->head.h : NULL;
+ Style = Window->style;
if ((Style & WS_POPUP) && Owner)
{
ChildObject = UserGetWindowObject(List[i]);
if (NULL != ChildObject)
{
- if (0 == (ChildObject->Wnd->ExStyle & WS_EX_TOPMOST))
+ if (0 == (ChildObject->ExStyle & WS_EX_TOPMOST))
{
break;
}
{
for (i = 0; List[i]; i++)
{
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
if (List[i] == hWnd)
break;
if (!(Wnd = UserGetWindowObject(List[i])))
continue;
- if (Wnd->Wnd->style & WS_POPUP && Wnd->spwndOwner == Window)
+ if (Wnd->style & WS_POPUP && Wnd->spwndOwner == Window)
{
USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Wnd, &Ref);
*/
static
VOID FASTCALL
-WinPosInternalMoveWindow(PWINDOW_OBJECT Window, INT MoveX, INT MoveY)
+WinPosInternalMoveWindow(PWND Window, INT MoveX, INT MoveY)
{
- PWINDOW_OBJECT Child;
+ PWND Child;
ASSERT(Window != Window->spwndChild);
- Window->Wnd->rcWindow.left += MoveX;
- Window->Wnd->rcWindow.right += MoveX;
- Window->Wnd->rcWindow.top += MoveY;
- Window->Wnd->rcWindow.bottom += MoveY;
+ Window->rcWindow.left += MoveX;
+ Window->rcWindow.right += MoveX;
+ Window->rcWindow.top += MoveY;
+ Window->rcWindow.bottom += MoveY;
- Window->Wnd->rcClient.left += MoveX;
- Window->Wnd->rcClient.right += MoveX;
- Window->Wnd->rcClient.top += MoveY;
- Window->Wnd->rcClient.bottom += MoveY;
+ Window->rcClient.left += MoveX;
+ Window->rcClient.right += MoveX;
+ Window->rcClient.top += MoveY;
+ Window->rcClient.bottom += MoveY;
for(Child = Window->spwndChild; Child; Child = Child->spwndNext)
{
*/
static
BOOL FASTCALL
-WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
+WinPosFixupFlags(WINDOWPOS *WinPos, PWND Wnd)
{
- PWND Wnd = Window->Wnd;
-
- if (!Wnd) return FALSE;
-
if (Wnd->style & WS_VISIBLE)
{
WinPos->flags &= ~SWP_SHOWWINDOW;
&& HWND_NOTOPMOST != WinPos->hwndInsertAfter
&& HWND_BOTTOM != WinPos->hwndInsertAfter)
{
- PWINDOW_OBJECT InsAfterWnd, Parent = Window->spwndParent;
+ PWND InsAfterWnd, Parent = Wnd->spwndParent;
InsAfterWnd = UserGetWindowObject(WinPos->hwndInsertAfter);
* itself.
*/
if ((WinPos->hwnd == WinPos->hwndInsertAfter) ||
- ((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->hSelf)))
+ ((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->head.h)))
{
WinPos->flags |= SWP_NOZORDER;
}
/* x and y are always screen relative */
BOOLEAN FASTCALL
co_WinPosSetWindowPos(
- PWINDOW_OBJECT Window,
+ PWND Window,
HWND WndInsertAfter,
INT x,
INT y,
HDC Dc;
RECTL CopyRect;
RECTL TempRect;
- PWINDOW_OBJECT Ancestor;
+ PWND Ancestor;
ASSERT_REFS_CO(Window);
- if (!Window->Wnd) return FALSE;
-
/* FIXME: Get current active window from active queue. */
/*
* Only allow CSRSS to mess with the desktop window
*/
- if ( Window->hSelf == IntGetDesktopWindow() &&
- Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
+ if ( Window->head.h == IntGetDesktopWindow() &&
+ Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
{
return FALSE;
}
- WinPos.hwnd = Window->hSelf;
+ WinPos.hwnd = Window->head.h;
WinPos.hwndInsertAfter = WndInsertAfter;
WinPos.x = x;
WinPos.y = y;
Ancestor = UserGetAncestor(Window, GA_PARENT);
if ( (WinPos.flags & (SWP_NOZORDER | SWP_HIDEWINDOW | SWP_SHOWWINDOW)) !=
SWP_NOZORDER &&
- Ancestor && Ancestor->hSelf == IntGetDesktopWindow() )
+ Ancestor && Ancestor->head.h == IntGetDesktopWindow() )
{
WinPos.hwndInsertAfter = WinPosDoOwnedPopups(WinPos.hwnd, WinPos.hwndInsertAfter);
}
else if(VisRgn)
{
RGNOBJAPI_Unlock(VisRgn);
- NtGdiOffsetRgn(VisBefore, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+ NtGdiOffsetRgn(VisBefore, -Window->rcWindow.left, -Window->rcWindow.top);
}
}
}
IntLinkHwnd(Window, WndInsertAfter);
}
- OldWindowRect = Window->Wnd->rcWindow;
- OldClientRect = Window->Wnd->rcClient;
+ OldWindowRect = Window->rcWindow;
+ OldClientRect = Window->rcClient;
if (OldClientRect.bottom - OldClientRect.top ==
NewClientRect.bottom - NewClientRect.top)
NewClientRect.top - OldClientRect.top);
}
- Window->Wnd->rcWindow = NewWindowRect;
- Window->Wnd->rcClient = NewClientRect;
+ Window->rcWindow = NewWindowRect;
+ Window->rcClient = NewClientRect;
if (!(WinPos.flags & SWP_SHOWWINDOW) && (WinPos.flags & SWP_HIDEWINDOW))
{
0,
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_ALLCHILDREN);
- if ((Window->Wnd->style & WS_VISIBLE) &&
+ if ((Window->style & WS_VISIBLE) &&
Window->spwndParent == UserGetDesktopWindow())
{
- co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->hSelf);
+ co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->head.h);
}
- Window->Wnd->style &= ~WS_VISIBLE;
+ Window->style &= ~WS_VISIBLE;
}
else if (WinPos.flags & SWP_SHOWWINDOW)
{
- if (!(Window->Wnd->style & WS_VISIBLE) &&
+ if (!(Window->style & WS_VISIBLE) &&
Window->spwndParent == UserGetDesktopWindow() )
{
- co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->hSelf);
+ co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->head.h);
}
- Window->Wnd->style |= WS_VISIBLE;
+ Window->style |= WS_VISIBLE;
}
if (Window->hrgnUpdate != NULL && Window->hrgnUpdate != (HRGN)1)
else if(VisRgn)
{
RGNOBJAPI_Unlock(VisRgn);
- NtGdiOffsetRgn(VisAfter, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+ NtGdiOffsetRgn(VisAfter, -Window->rcWindow.left, -Window->rcWindow.top);
}
/*
VisAfter != NULL &&
!(WinPos.flags & SWP_NOCOPYBITS) &&
((WinPos.flags & SWP_NOSIZE) || !(WvrFlags & WVR_REDRAW)) &&
- !(Window->Wnd->ExStyle & WS_EX_TRANSPARENT) )
+ !(Window->ExStyle & WS_EX_TRANSPARENT) )
{
CopyRgn = IntSysCreateRectRgn(0, 0, 0, 0);
RgnType = NtGdiCombineRgn(CopyRgn, VisAfter, VisBefore, RGN_AND);
GreDeleteObject(DirtyRgn);
*/
- PWINDOW_OBJECT Parent = Window->spwndParent;
+ PWND Parent = Window->spwndParent;
NtGdiOffsetRgn( DirtyRgn,
- Window->Wnd->rcWindow.left,
- Window->Wnd->rcWindow.top);
- if ( (Window->Wnd->style & WS_CHILD) &&
+ Window->rcWindow.left,
+ Window->rcWindow.top);
+ if ( (Window->style & WS_CHILD) &&
(Parent) &&
- !(Parent->Wnd->style & WS_CLIPCHILDREN))
+ !(Parent->style & WS_CLIPCHILDREN))
{
IntInvalidateWindows( Parent,
DirtyRgn,
if (!(WinPos.flags & SWP_NOACTIVATE))
{
- if ((Window->Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
+ if ((Window->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
co_IntSendMessageNoWait(WinPos.hwnd, WM_CHILDACTIVATE, 0, 0);
}
}
LRESULT FASTCALL
-co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientRect)
+co_WinPosGetNonClientSize(PWND Window, RECT* WindowRect, RECT* ClientRect)
{
LRESULT Result;
ASSERT_REFS_CO(Window);
*ClientRect = *WindowRect;
- Result = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect);
+ Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect);
FixClientRect(ClientRect, WindowRect);
}
void FASTCALL
-co_WinPosSendSizeMove(PWINDOW_OBJECT Window)
+co_WinPosSendSizeMove(PWND Wnd)
{
WPARAM wParam = SIZE_RESTORED;
- PWND Wnd = Window->Wnd;
- Window->state &= ~WINDOWOBJECT_NEED_SIZE;
+ Wnd->state &= ~WNDS_SENDSIZEMOVEMSGS;
if (Wnd->style & WS_MAXIMIZE)
{
wParam = SIZE_MAXIMIZED;
wParam = SIZE_MINIMIZED;
}
- co_IntSendMessageNoWait(Window->hSelf, WM_SIZE, wParam,
+ co_IntSendMessageNoWait(Wnd->head.h, WM_SIZE, wParam,
MAKELONG(Wnd->rcClient.right -
Wnd->rcClient.left,
Wnd->rcClient.bottom -
Wnd->rcClient.top));
- co_IntSendMessageNoWait(Window->hSelf, WM_MOVE, 0,
+ co_IntSendMessageNoWait(Wnd->head.h, WM_MOVE, 0,
MAKELONG(Wnd->rcClient.left,
Wnd->rcClient.top));
- IntEngWindowChanged(Window, WOC_RGN_CLIENT);
+ IntEngWindowChanged(Wnd, WOC_RGN_CLIENT);
}
BOOLEAN FASTCALL
-co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
+co_WinPosShowWindow(PWND Wnd, INT Cmd)
{
BOOLEAN WasVisible;
UINT Swp = 0;
RECTL NewPos;
BOOLEAN ShowFlag;
// HRGN VisibleRgn;
- PWND Wnd;
-
- ASSERT_REFS_CO(Window);
- Wnd = Window->Wnd;
- if (!Wnd) return FALSE;
+ ASSERT_REFS_CO(Wnd);
WasVisible = (Wnd->style & WS_VISIBLE) != 0;
return(FALSE);
}
Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE;
- if (Window->hSelf != UserGetActiveWindow())
+ if (Wnd->head.h != UserGetActiveWindow())
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
break;
}
Swp |= SWP_NOACTIVATE;
if (!(Wnd->style & WS_MINIMIZE))
{
- Swp |= co_WinPosMinMaximize(Window, SW_MINIMIZE, &NewPos) |
+ Swp |= co_WinPosMinMaximize(Wnd, SW_MINIMIZE, &NewPos) |
SWP_FRAMECHANGED;
}
else
Swp |= SWP_SHOWWINDOW;
if (!(Wnd->style & WS_MAXIMIZE))
{
- Swp |= co_WinPosMinMaximize(Window, SW_MAXIMIZE, &NewPos) |
+ Swp |= co_WinPosMinMaximize(Wnd, SW_MAXIMIZE, &NewPos) |
SWP_FRAMECHANGED;
}
else
Swp |= SWP_SHOWWINDOW;
if (Wnd->style & (WS_MINIMIZE | WS_MAXIMIZE))
{
- Swp |= co_WinPosMinMaximize(Window, SW_RESTORE, &NewPos) |
+ Swp |= co_WinPosMinMaximize(Wnd, SW_RESTORE, &NewPos) |
SWP_FRAMECHANGED;
}
else
if (ShowFlag != WasVisible)
{
- co_IntSendMessageNoWait(Window->hSelf, WM_SHOWWINDOW, ShowFlag, 0);
+ co_IntSendMessageNoWait(Wnd->head.h, WM_SHOWWINDOW, ShowFlag, 0);
}
/* We can't activate a child window */
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
}
- co_WinPosSetWindowPos(Window, 0 != (Wnd->ExStyle & WS_EX_TOPMOST)
+ co_WinPosSetWindowPos(Wnd, 0 != (Wnd->ExStyle & WS_EX_TOPMOST)
? HWND_TOPMOST : HWND_TOP,
NewPos.left, NewPos.top, NewPos.right, NewPos.bottom, LOWORD(Swp));
if ((Cmd == SW_HIDE) || (Cmd == SW_MINIMIZE))
{
- PWINDOW_OBJECT ThreadFocusWindow;
+ PWND ThreadFocusWindow;
/* FIXME: This will cause the window to be activated irrespective
* of whether it is owned by the same thread. Has to be done
* asynchronously.
*/
- if (Window->hSelf == UserGetActiveWindow())
+ if (Wnd->head.h == UserGetActiveWindow())
{
- co_WinPosActivateOtherWindow(Window);
+ co_WinPosActivateOtherWindow(Wnd);
}
ThreadFocusWindow = UserGetWindowObject(IntGetThreadFocusWindow());
/* Revert focus to parent */
- if (ThreadFocusWindow && (Window == ThreadFocusWindow ||
- IntIsChildWindow(Window, ThreadFocusWindow)))
+ if (ThreadFocusWindow && (Wnd == ThreadFocusWindow ||
+ IntIsChildWindow(Wnd, ThreadFocusWindow)))
{
//faxme: as long as we have ref on Window, we also, indirectly, have ref on parent...
- co_UserSetFocus(Window->spwndParent);
+ co_UserSetFocus(Wnd->spwndParent);
}
}
/* FIXME: Check for window destruction. */
- if ((Window->state & WINDOWOBJECT_NEED_SIZE) &&
- !(Window->state & WINDOWSTATUS_DESTROYING))
+ if ((Wnd->state & WNDS_SENDSIZEMOVEMSGS) &&
+ !(Wnd->state2 & WNDS2_INDESTROY))
{
- co_WinPosSendSizeMove(Window);
+ co_WinPosSendSizeMove(Wnd);
}
/* Activate the window if activation is not requested and the window is not minimized */
#if 0
/* find child of 'parent' that contains the given point (in parent-relative coords) */
-PWINDOW_OBJECT child_window_from_point(PWINDOW_OBJECT parent, int x, int y )
+PWND child_window_from_point(PWND parent, int x, int y )
{
- PWINDOW_OBJECT Wnd;// = parent->spwndChild;
+ PWND Wnd;// = parent->spwndChild;
// LIST_FOR_EACH_ENTRY( Wnd, &parent->children, struct window, entry )
for (Wnd = parent->spwndChild; Wnd; Wnd = Wnd->spwndNext)
static
VOID FASTCALL
co_WinPosSearchChildren(
- PWINDOW_OBJECT ScopeWin,
+ PWND ScopeWin,
PUSER_MESSAGE_QUEUE OnlyHitTests,
POINT *Point,
- PWINDOW_OBJECT* Window,
+ PWND* Window,
USHORT *HitTest
)
{
- PWINDOW_OBJECT Current;
- PWND CurrentWnd;
+ PWND Current;
HWND *List, *phWnd;
USER_REFERENCE_ENTRY Ref;
{
if (!(Current = UserGetWindowObject(*phWnd)))
continue;
- CurrentWnd = Current->Wnd;
- if (!(CurrentWnd->style & WS_VISIBLE))
+ if (!(Current->style & WS_VISIBLE))
{
continue;
}
- if ((CurrentWnd->style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
+ if ((Current->style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
(WS_CHILD | WS_DISABLED))
{
continue;
*Window = Current;
UserReferenceObject(*Window);
- if (CurrentWnd->style & WS_MINIMIZE)
+ if (Current->style & WS_MINIMIZE)
{
*HitTest = HTCAPTION;
break;
}
- if (CurrentWnd->style & WS_DISABLED)
+ if (Current->style & WS_DISABLED)
{
*HitTest = HTERROR;
break;
UserRefObjectCo(Current, &Ref);
- if (OnlyHitTests && (Current->pti->MessageQueue == OnlyHitTests))
+ if (OnlyHitTests && (Current->head.pti->MessageQueue == OnlyHitTests))
{
- *HitTest = co_IntSendMessage(Current->hSelf, WM_NCHITTEST, 0,
+ *HitTest = co_IntSendMessage(Current->head.h, WM_NCHITTEST, 0,
MAKELONG(Point->x, Point->y));
if ((*HitTest) == (USHORT)HTTRANSPARENT)
{
else
*HitTest = HTCLIENT;
- if (Point->x >= CurrentWnd->rcClient.left &&
- Point->x < CurrentWnd->rcClient.right &&
- Point->y >= CurrentWnd->rcClient.top &&
- Point->y < CurrentWnd->rcClient.bottom)
+ if (Point->x >= Current->rcClient.left &&
+ Point->x < Current->rcClient.right &&
+ Point->y >= Current->rcClient.top &&
+ Point->y < Current->rcClient.bottom)
{
co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
}
/* wine: WINPOS_WindowFromPoint */
USHORT FASTCALL
-co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
- PWINDOW_OBJECT* Window)
+co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
+ PWND* Window)
{
HWND DesktopWindowHandle;
- PWINDOW_OBJECT DesktopWindow;
+ PWND DesktopWindow;
POINT Point = *WinPoint;
USHORT HitTest;
return(HTERROR);
}
- if (ScopeWin->Wnd->style & WS_DISABLED)
+ if (ScopeWin->style & WS_DISABLED)
{
return(HTERROR);
}
/* Translate the point to the space of the scope window. */
DesktopWindowHandle = IntGetDesktopWindow();
- if((DesktopWindowHandle != ScopeWin->hSelf) &&
+ if((DesktopWindowHandle != ScopeWin->head.h) &&
(DesktopWindow = UserGetWindowObject(DesktopWindowHandle)))
{
- Point.x += ScopeWin->Wnd->rcClient.left - DesktopWindow->Wnd->rcClient.left;
- Point.y += ScopeWin->Wnd->rcClient.top - DesktopWindow->Wnd->rcClient.top;
+ Point.x += ScopeWin->rcClient.left - DesktopWindow->rcClient.left;
+ Point.y += ScopeWin->rcClient.top - DesktopWindow->rcClient.top;
}
HitTest = HTNOWHERE;
BOOL SendMessage)
{
POINT Size;
- PWINDOW_OBJECT Window = NULL;
- PWND Wnd;
+ PWND Window = NULL;
MINMAXINFO SafeMinMax;
NTSTATUS Status;
BOOL ret;
}
UserRefObjectCo(Window, &Ref);
- Wnd = Window->Wnd;
- Size.x = Window->Wnd->rcWindow.left;
- Size.y = Window->Wnd->rcWindow.top;
+ Size.x = Window->rcWindow.left;
+ Size.y = Window->rcWindow.top;
WinPosInitInternalPos(Window, &Size,
- &Wnd->rcWindow);
+ &Window->rcWindow);
co_WinPosGetMinMaxInfo(Window, &SafeMinMax.ptMaxSize, &SafeMinMax.ptMaxPosition,
&SafeMinMax.ptMinTrackSize, &SafeMinMax.ptMaxTrackSize);
{
WCHAR szBuffer[MAX_DRIVER_NAME];
PDC DC;
- PWINDOW_OBJECT Wnd=NULL;
+ PWND Wnd=NULL;
HWND hWnd;
HDC hDC;
if (pDeviceName == NULL || pDeviceName->Length == 0)
{
- PWINDOW_OBJECT DesktopObject;
+ PWND DesktopObject;
HDC DesktopHDC;
PDC pDC;
UINT pal_entries;
HDC hDC;
PDC dc;
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
const PALETTEENTRY *pptr = PaletteColors;
palPtr = (PPALETTE)PALETTE_LockPalette(hPal);
APIENTRY
NtGdiUpdateColors(HDC hDC)
{
- PWINDOW_OBJECT Wnd;
+ PWND Wnd;
BOOL calledFromUser, ret;
USER_REFERENCE_ENTRY Ref;