1 #ifndef _WIN32K_WINDOW_H
2 #define _WIN32K_WINDOW_H
6 typedef struct _WINDOW_OBJECT
*PWINDOW_OBJECT
;
8 #include <include/object.h>
9 #include <include/class.h>
10 #include <include/msgqueue.h>
11 #include <include/winsta.h>
12 #include <include/dce.h>
13 #include <include/prop.h>
14 #include <include/scroll.h>
18 WinPosSetupInternalPos(VOID
);
20 typedef struct _INTERNALPOS
25 } INTERNALPOS
, *PINTERNALPOS
;
27 typedef struct _WINDOW_OBJECT
29 /* Pointer to the window class. */
30 PWNDCLASS_OBJECT Class
;
31 /* entry in the window list of the class object */
32 LIST_ENTRY ClassListEntry
;
36 UNICODE_STRING WindowName
;
41 /* system menu handle. */
43 /* Handle of the module that created the window. */
45 /* Entry in the thread's list of windows. */
47 /* Pointer to the extra data associated with the window. */
49 /* Size of the extra data associated with the window. */
51 /* Position of the window. */
53 /* Position of the window's client area. */
55 /* Handle for the window. */
59 /* Window menu handle or window id */
61 /* Handle of region of the window to be updated. */
63 HANDLE NCUpdateRegion
;
64 /* Handle of the window region. */
66 /* Lock to be held when manipulating (NC)UpdateRegion */
67 FAST_MUTEX UpdateLock
;
68 /* Pointer to the owning thread's message queue. */
69 PUSER_MESSAGE_QUEUE MessageQueue
;
70 struct _WINDOW_OBJECT
* FirstChild
;
71 struct _WINDOW_OBJECT
* LastChild
;
72 struct _WINDOW_OBJECT
* NextSibling
;
73 struct _WINDOW_OBJECT
* PrevSibling
;
74 /* Entry in the list of thread windows. */
75 LIST_ENTRY ThreadListEntry
;
76 /* Handle to the parent window. */
78 /* Handle to the owner window. */
80 /* DC Entries (DCE) */
82 /* Property list head.*/
83 LIST_ENTRY PropListHead
;
86 PWINDOW_SCROLLINFO Scroll
;
92 HWND hWndLastPopup
; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
93 PINTERNALPOS InternalPos
;
95 /* counter for tiled child windows */
98 LIST_ENTRY WndObjListHead
;
99 FAST_MUTEX WndObjListLock
;
100 } WINDOW_OBJECT
; /* PWINDOW_OBJECT already declared at top of file */
103 #define WINDOWOBJECT_NEED_SIZE (0x00000001)
104 #define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002)
105 #define WINDOWOBJECT_NEED_NCPAINT (0x00000004)
106 #define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008)
107 #define WINDOWOBJECT_RESTOREMAX (0x00000020)
109 #define WINDOWSTATUS_DESTROYING (0x1)
110 #define WINDOWSTATUS_DESTROYED (0x2)
112 #define HAS_DLGFRAME(Style, ExStyle) \
113 (((ExStyle) & WS_EX_DLGMODALFRAME) || \
114 (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
116 #define HAS_THICKFRAME(Style, ExStyle) \
117 (((Style) & WS_THICKFRAME) && \
118 (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
120 #define HAS_THINFRAME(Style, ExStyle) \
121 (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
123 #define IntIsDesktopWindow(WndObj) \
124 (WndObj->Parent == NULL)
126 #define IntIsBroadcastHwnd(hWnd) \
127 (hWnd == HWND_BROADCAST || hWnd == HWND_TOPMOST)
129 #define IntGetWindowObject(hWnd) \
130 IntGetProcessWindowObject(PsGetWin32Thread(), hWnd)
132 #define IntReferenceWindowObject(WndObj) \
133 ObmReferenceObjectByPointer(WndObj, otWindow)
135 #define IntReleaseWindowObject(WndObj) \
136 ObmDereferenceObject(WndObj)
138 #define IntWndBelongsToThread(WndObj, W32Thread) \
139 (((WndObj->OwnerThread && WndObj->OwnerThread->Tcb.Win32Thread)) && \
140 (WndObj->OwnerThread->Tcb.Win32Thread == W32Thread))
142 #define IntGetWndThreadId(WndObj) \
143 WndObj->OwnerThread->Cid.UniqueThread
145 #define IntGetWndProcessId(WndObj) \
146 WndObj->OwnerThread->ThreadsProcess->UniqueProcessId
149 PWINDOW_OBJECT FASTCALL
150 IntGetProcessWindowObject(PW32THREAD Thread
, HWND hWnd
);
153 IntIsWindow(HWND hWnd
);
156 IntWinListChildren(PWINDOW_OBJECT Window
);
159 InitWindowImpl (VOID
);
162 CleanupWindowImpl (VOID
);
165 IntGetClientRect (PWINDOW_OBJECT WindowObject
, PRECT Rect
);
168 IntGetActiveWindow (VOID
);
171 IntIsWindowVisible (HWND hWnd
);
174 IntIsChildWindow (HWND Parent
, HWND Child
);
177 IntUnlinkWindow(PWINDOW_OBJECT Wnd
);
180 IntLinkWindow(PWINDOW_OBJECT Wnd
, PWINDOW_OBJECT WndParent
, PWINDOW_OBJECT WndPrevSibling
);
182 PWINDOW_OBJECT FASTCALL
183 IntGetAncestor(PWINDOW_OBJECT Wnd
, UINT Type
);
185 PWINDOW_OBJECT FASTCALL
186 IntGetParent(PWINDOW_OBJECT Wnd
);
188 PWINDOW_OBJECT FASTCALL
189 IntGetOwner(PWINDOW_OBJECT Wnd
);
191 PWINDOW_OBJECT FASTCALL
192 IntGetParentObject(PWINDOW_OBJECT Wnd
);
195 IntGetWindowRgn(HWND hWnd
, HRGN hRgn
);
198 IntGetWindowRgnBox(HWND hWnd
, RECT
*Rect
);
201 IntGetWindowInfo(PWINDOW_OBJECT WindowObject
, PWINDOWINFO pwi
);
204 IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject
, UINT
*cx
, UINT
*cy
);
210 IntIsWindowInDestroy(PWINDOW_OBJECT Window
);
212 DWORD
IntRemoveWndProcHandle(WNDPROC Handle
);
213 DWORD
IntRemoveProcessWndProcHandles(HANDLE ProcessID
);
214 DWORD
IntAddWndProcHandle(WNDPROC WindowProc
, BOOL IsUnicode
);
217 IntShowOwnedPopups( HWND owner
, BOOL fShow
);
219 #endif /* _WIN32K_WINDOW_H */