80#define EXPECT_NEXT(hWnd1, hWnd2) \
81 ok(IsNext(hWnd1, hWnd2), \
82 "After hwnd%d, expected hwnd%d not hwnd%d\n", \
83 get_iwnd(hWnd1), get_iwnd(hWnd2),get_iwnd(GetWindow(hWnd1,GW_HWNDNEXT)) )
85#define EXPECT_CHAIN(A,B,C,D) \
86 EXPECT_NEXT(hWnd##A, hWnd##B); \
87 EXPECT_NEXT(hWnd##B, hWnd##C); \
88 EXPECT_NEXT(hWnd##C, hWnd##D);
90#define ok_windowpos(hwnd, x, y, w, h, wnd) do { RECT rt; GetWindowRect(hwnd, &rt); \
91 ok(rt.left == (x) && rt.top == (y) && rt.right == (x)+(w) && rt.bottom == (y)+(h), \
92 "Unexpected %s position: (%ld, %ld) - (%ld, %ld)\n", wnd, rt.left, rt.top, rt.right, rt.bottom); } while (0)
94#define ok_lasterr(err, s) ok(GetLastError() == (err), "%s error = %lu\n", s, GetLastError())
118 ok(
ret == 0,
"EndDeferWindowPos succeeded with invalid handle\n");
123 ok(
ret == 0,
"EndDeferWindowPos succeeded with invalid handle\n");
129 ok(hDwp ==
NULL,
"BeginDeferWindowPos failed\n");
135 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
138 ok(
ret != 0,
"EndDeferWindowPos failed\n");
144 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
147 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
150 ok(
ret != 0,
"EndDeferWindowPos failed\n");
159 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
162 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
165 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
168 ok(
ret != 0,
"EndDeferWindowPos failed\n");
177 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
180 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
183 ok(
ret != 0,
"EndDeferWindowPos failed\n");
190 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
193 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
196 ok(
ret != 0,
"EndDeferWindowPos failed\n");
203 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
206 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
209 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
212 ok(
ret != 0,
"EndDeferWindowPos failed\n");
219 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
222 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
225 ok(
ret != 0,
"EndDeferWindowPos failed\n");
232 ok(hDwp !=
NULL,
"BeginDeferWindowPos failed\n");
235 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
238 ok(hDwp !=
NULL,
"DeferWindowPos failed\n");
241 ok(
ret != 0,
"EndDeferWindowPos failed\n");
302 ok(hdwp !=
NULL,
"BeginDeferWindowPos failed\n");
304 ok(hdwp !=
NULL,
"DeferWindowPos failed\n");
308 ok(
ret != 0,
"EndDeferWindowPos failed\n");
314 ok(hdwp !=
NULL,
"BeginDeferWindowPos failed\n");
316 ok(hdwp !=
NULL,
"DeferWindowPos failed\n");
320 ok(
ret != 0,
"EndDeferWindowPos failed\n");
326 ok(hdwp !=
NULL,
"BeginDeferWindowPos failed\n");
328 ok(hdwp !=
NULL,
"DeferWindowPos failed\n");
330 ok(hdwp !=
NULL,
"DeferWindowPos failed\n");
334 ok(
ret != 0,
"EndDeferWindowPos failed\n");
340 ok(hdwp !=
NULL,
"BeginDeferWindowPos failed\n");
342 ok(hdwp !=
NULL,
"DeferWindowPos failed\n");
346 ok(
ret != 0,
"EndDeferWindowPos failed\n");
352 ok(hdwp !=
NULL,
"BeginDeferWindowPos failed\n");
354 ok(hdwp !=
NULL,
"DeferWindowPos failed\n");
356 ok(hdwp !=
NULL,
"DeferWindowPos failed\n");
360 ok(
ret != 0,
"EndDeferWindowPos failed\n");
366#define OwnerZOrderAParams SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOSIZE
401#define OwnerZOrderBParams SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOOWNERZORDER
static void Test_DWP_Error(HWND hWnd, HWND hWnd2)
MSG_ENTRY OwnerZOrder4A_chain[]
MSG_ENTRY OwnerZOrder5B_chain[]
static void FlushMessages()
MSG_ENTRY move1_2_chain[]
#define ok_windowpos(hwnd, x, y, w, h, wnd)
#define OwnerZOrderAParams
MSG_ENTRY OwnerZOrder5A_chain[]
MSG_ENTRY resize1_chain[]
static int get_iwnd(HWND hWnd)
static void Test_DWP_SimpleMsg(HWND hWnd1, HWND hWnd2)
static void set_default_pos()
#define EXPECT_CHAIN(A, B, C, D)
static BOOL IsNext(HWND hWnd1, HWND hWnd2)
MSG_ENTRY OwnerZOrder3B_chain[]
MSG_ENTRY OwnerZOrder1B_chain[]
MSG_ENTRY OwnerZOrder1A_chain[]
#define ok_lasterr(err, s)
#define OwnerZOrderBParams
MSG_ENTRY OwnerZOrder2A_chain[]
MSG_ENTRY OwnerZOrder4B_chain[]
MSG_ENTRY OwnerZOrder2B_chain[]
MSG_ENTRY ZOrder1and2_chain[]
LRESULT CALLBACK DWPTestProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
MSG_ENTRY OwnerZOrder3A_chain[]
static void Test_DWP_OwnerZOrder()
MSG_ENTRY ZOrder1_chain[]
#define ERROR_INVALID_PARAMETER
static BOOL IsDWmMsg(UINT msg)
#define RECORD_MESSAGE(...)
#define COMPARE_CACHE(msg_chain)
static BOOL IseKeyMsg(UINT msg)
#define WS_OVERLAPPEDWINDOW
TW_UINT32 TW_UINT16 TW_UINT16 MSG
static __inline ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName)
DWORD WINAPI GetLastError(void)
#define ERROR_INVALID_DWP_HANDLE
#define ERROR_INVALID_WINDOW_HANDLE
#define DNS_ERROR_RCODE_NXRRSET
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define WM_WINDOWPOSCHANGING
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
#define WM_IME_SETCONTEXT
HWND WINAPI SetActiveWindow(_In_ HWND)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define SWP_NOOWNERZORDER
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_WINDOWPOSCHANGED
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
HDWP WINAPI BeginDeferWindowPos(_In_ int)