ReactOS 0.4.15-dev-7942-gd23573b
window.h
Go to the documentation of this file.
1#pragma once
2
3extern ATOM AtomMessage;
4extern ATOM AtomWndObj; /* WNDOBJ list */
5extern ATOM AtomLayer;
8
9#define HAS_DLGFRAME(Style, ExStyle) \
10 (((ExStyle) & WS_EX_DLGMODALFRAME) || \
11 (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
12
13#define HAS_THICKFRAME(Style, ExStyle) \
14 (((Style) & WS_THICKFRAME) && \
15 (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
16
17#define HAS_THINFRAME(Style, ExStyle) \
18 (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
19
20#define HAS_CLIENTFRAME(Style, ExStyle) \
21 (((ExStyle) & WS_EX_CLIENTEDGE) || (!((Style) & (WS_CHILD | WS_POPUP))))
22
23#define HAS_MENU(pWnd,style) ((((style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) && (pWnd->IDMenu) && IntIsMenu(UlongToHandle(pWnd->IDMenu)))
24
25#define IntIsDesktopWindow(WndObj) \
26 (WndObj->spwndParent == NULL)
27
28#define IntIsBroadcastHwnd(hWnd) \
29 (hWnd == HWND_BROADCAST || hWnd == HWND_TOPMOST)
30
31
32#define IntWndBelongsToThread(WndObj, W32Thread) \
33 ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
34
35#define IntGetWndThreadId(WndObj) \
36 PsGetThreadId(WndObj->head.pti->pEThread)
37
38#define IntGetWndProcessId(WndObj) \
39 PsGetProcessId(WndObj->head.pti->ppi->peProcess)
40
47INT FASTCALL IntMapWindowPoints(PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints);
50VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev);
56#define WINVER_WIN2K _WIN32_WINNT_WIN2K
57#define WINVER_WINNT4 _WIN32_WINNT_NT4
58#define WINVER_WIN31 0x30A
60 PLARGE_STRING WindowName,
61 PCLS Class,
62 PWND ParentWindow,
63 PWND OwnerWindow,
64 PVOID acbiBuffer,
65 PDESKTOP pdeskCreated,
66 DWORD dwVer );
68 PUNICODE_STRING ClassName,
69 PLARGE_STRING WindowName,
70 PVOID acbiBuffer,
71 DWORD dwVer );
82
83#define HWND_TERMINATOR ((HWND)(ULONG_PTR)1)
84
85typedef struct tagWINDOWLIST
86{
91 HWND ahwnd[ANYSIZE_ARRAY]; /* Terminated by HWND_TERMINATOR */
93
96
97#define WL_IS_BAD(pwl) ((pwl)->phwndEnd <= (pwl)->phwndLast)
98#define WL_CAPACITY(pwl) ((pwl)->phwndEnd - &((pwl)->ahwnd[0]))
99
102HWND FASTCALL IntFindWindow(PWND Parent, PWND ChildAfter, RTL_ATOM ClassAtom,
103 PUNICODE_STRING WindowName);
104
105/* Undocumented dwFlags for IntBuildHwndList */
106#define IACE_LIST 0x0002
107
108#define IS_WND_CHILD(pWnd) ((pWnd)->style & WS_CHILD)
109#define IS_WND_MENU(pWnd) ((pWnd)->pcls->atomClassName == gpsi->atomSysClass[ICLS_MENU])
110
111// The IME-like windows are the IME windows and the IME UI windows.
112// The IME window's class name is "IME".
113// The IME UI window behaves the User Interface of IME for the user.
114#define IS_WND_IMELIKE(pWnd) \
115 (((pWnd)->pcls->style & CS_IME) || \
116 ((pWnd)->pcls->atomClassName == gpsi->atomSysClass[ICLS_IME]))
117
118extern BOOL gfIMEShowStatus;
119
123BOOL FASTCALL IntImeCanDestroyDefIME(PWND pImeWnd, PWND pwndTarget);
127
128static inline
129VOID
131{
132 /* First reference the new one */
133 if (pwndNew != NULL)
134 {
135 UserReferenceObject(pwndNew);
136 }
137
138 /* Then dereference the previous one */
139 if (*ppwnd != NULL)
140 {
141 UserDereferenceObject(*ppwnd);
142 }
143
144 /* And set */
145 *ppwnd = pwndNew;
146}
147
148static inline
149VOID
151{
152 ReplaceWndPtr(&pwnd->spwndOwner, pwndOwner);
153}
154
155static inline
156VOID
158{
159 ReplaceWndPtr(&pwnd->spwndParent, pwndParent);
160}
161
162static inline
163VOID
165{
166 ReplaceWndPtr(&pwnd->spwndChild, pwndChild);
167}
168
169static inline
170VOID
172{
173 ReplaceWndPtr(&pwnd->spwndNext, pwndNext);
174}
175
176static inline
177VOID
179{
180 ReplaceWndPtr(&pwnd->spwndPrev, pwndPrev);
181}
182
183static inline
184VOID
186{
187 ReplaceWndPtr(&pwnd->spwndLastActive, pwndLastActive);
188}
189
190/* EOF */
unsigned char BOOLEAN
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
HWND hWnd
Definition: settings.c:17
struct @1632 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define ValidateHwndNoErr(hwnd)
Definition: precomp.h:84
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short RTL_ATOM
Definition: atom.c:42
#define _Inout_
Definition: ms_sal.h:378
#define _In_opt_
Definition: ms_sal.h:309
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define FASTCALL
Definition: nt_native.h:50
long LONG
Definition: pedump.c:60
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
Definition: window.c:28
Definition: ntuser.h:566
Definition: ntuser.h:694
HWND * phwndLast
Definition: window.h:88
HWND ahwnd[ANYSIZE_ARRAY]
Definition: window.h:91
struct tagWINDOWLIST * pNextList
Definition: window.h:87
PTHREADINFO pti
Definition: window.h:90
HWND * phwndEnd
Definition: window.h:89
#define ANYSIZE_ARRAY
Definition: typedefs.h:46
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:644
VOID FASTCALL UserReferenceObject(PVOID obj)
Definition: object.c:731
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:274
static VOID WndSetPrev(_Inout_ PWND pwnd, _In_opt_ PWND pwndPrev)
Definition: window.h:178
static VOID WndSetOwner(_Inout_ PWND pwnd, _In_opt_ PWND pwndOwner)
Definition: window.h:150
ATOM AtomWndObj
Definition: ntuser.c:20
static VOID ReplaceWndPtr(_Inout_ PWND *ppwnd, _In_opt_ PWND pwndNew)
Definition: window.h:130
BOOL g_bWindowSnapEnabled
Definition: sysparams.c:20
LONG_PTR FASTCALL co_UserSetWindowLongPtr(HWND, DWORD, LONG_PTR, BOOL)
Definition: window.c:4026
INT FASTCALL IntMapWindowPoints(PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints)
Definition: winpos.c:144
struct tagWINDOWLIST * PWINDOWLIST
HWND FASTCALL IntGetWindow(HWND, UINT)
Definition: window.c:381
BOOL FASTCALL IntEnableWindow(HWND, BOOL)
Definition: window.c:220
DWORD FASTCALL GetNCHitEx(PWND, POINT)
Definition: nonclient.c:1954
VOID FASTCALL IntGetWindowBorderMeasures(PWND WindowObject, UINT *cx, UINT *cy)
Definition: winpos.c:861
VOID FASTCALL IntFreeHwndList(PWINDOWLIST pwlTarget)
Definition: window.c:1470
ATOM AtomFlashWndState
Definition: ntuser.c:22
PWINDOWLIST gpwlCache
Definition: window.c:17
BOOL FASTCALL IntImeCanDestroyDefIME(PWND pImeWnd, PWND pwndTarget)
Definition: ime.c:2065
PWND FASTCALL IntGetParent(PWND Wnd)
Definition: window.c:204
HWND *FASTCALL IntWinListOwnedPopups(PWND Window)
Definition: window.c:315
LONG FASTCALL co_UserSetWindowLong(HWND, DWORD, LONG, BOOL)
Definition: window.c:4020
BOOL FASTCALL IntIsChildWindow(PWND Parent, PWND Child)
Definition: window.c:927
BOOL gfIMEShowStatus
Definition: ime.c:29
LRESULT FASTCALL IntDefWindowProc(PWND Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi)
Definition: defwnd.c:535
VOID FASTCALL IntCheckImeShowStatusInThread(PWND pImeWnd)
Definition: ime.c:2397
PWND FASTCALL IntCreateWindow(CREATESTRUCTW *Cs, PLARGE_STRING WindowName, PCLS Class, PWND ParentWindow, PWND OwnerWindow, PVOID acbiBuffer, PDESKTOP pdeskCreated, DWORD dwVer)
Definition: window.c:1801
PWND FASTCALL co_IntCreateDefaultImeWindow(PWND pwndTarget, HINSTANCE hInst)
Definition: ime.c:1957
BOOL FASTCALL IntShowOwnedPopups(PWND owner, BOOL fShow)
Definition: window.c:4649
static VOID WndSetChild(_Inout_ PWND pwnd, _In_opt_ PWND pwndChild)
Definition: window.h:164
BOOL FASTCALL IntIsWindowVisible(PWND)
Definition: window.c:189
HWND FASTCALL IntFindWindow(PWND Parent, PWND ChildAfter, RTL_ATOM ClassAtom, PUNICODE_STRING WindowName)
Definition: window.c:3061
PWND FASTCALL IntGetNonChildAncestor(PWND)
Definition: window.c:351
VOID FASTCALL IntUnlinkWindow(PWND Wnd)
Definition: window.c:1354
BOOL FASTCALL IntImeCanDestroyDefIMEforChild(PWND pImeWnd, PWND pwndTarget)
Definition: ime.c:2020
VOID FASTCALL IntGetClientRect(PWND WindowObject, RECTL *Rect)
Definition: winpos.c:92
static VOID WndSetNext(_Inout_ PWND pwnd, _In_opt_ PWND pwndNext)
Definition: window.h:171
BOOL FASTCALL IntWantImeWindow(PWND pwndTarget)
Definition: ime.c:1917
LRESULT co_UserFreeWindow(PWND, PPROCESSINFO, PTHREADINFO, BOOLEAN)
Definition: window.c:574
PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW *Cs, PUNICODE_STRING ClassName, PLARGE_STRING WindowName, PVOID acbiBuffer, DWORD dwVer)
Definition: window.c:2173
ATOM AtomLayer
Definition: ntuser.c:21
static VOID WndSetParent(_Inout_ PWND pwnd, _In_opt_ PWND pwndParent)
Definition: window.h:157
VOID FASTCALL IntNotifyImeShowStatus(PWND pImeWnd)
Definition: ime.c:2326
VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG, DWORD)
Definition: event.c:178
BOOL FASTCALL IntIsWindow(HWND hWnd)
Definition: window.c:176
BOOL FASTCALL IntBroadcastImeShowStatusChange(PWND pImeWnd, BOOL bShow)
Definition: ime.c:2386
BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam)
Definition: window.c:38
PWINDOWLIST FASTCALL IntBuildHwndList(PWND pwnd, DWORD dwFlags, PTHREADINFO pti)
Definition: window.c:1424
ULONG FASTCALL IntSetStyle(PWND, ULONG, ULONG)
Definition: window.c:143
VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev)
Definition: window.c:983
struct tagWINDOWLIST WINDOWLIST
PWINDOWLIST gpwlList
Definition: window.c:16
PWND FASTCALL VerifyWnd(PWND)
Definition: window.c:86
static VOID WndSetLastActive(_Inout_ PWND pwnd, _In_opt_ PWND pwndLastActive)
Definition: window.h:185
ATOM AtomMessage
Definition: ntuser.c:19
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207