ReactOS 0.4.15-dev-8434-g155a7c7
DeferWindowPos.c File Reference
#include "precomp.h"
Include dependency graph for DeferWindowPos.c:

Go to the source code of this file.

Macros

#define EXPECT_NEXT(hWnd1, hWnd2)
 
#define EXPECT_CHAIN(A, B, C, D)
 
#define ok_windowpos(hwnd, x, y, w, h, wnd)
 
#define ok_lasterr(err, s)   ok(GetLastError() == (err), "%s error = %lu\n", s, GetLastError())
 
#define OwnerZOrderAParams   SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOSIZE
 
#define OwnerZOrderBParams   SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOOWNERZORDER
 

Functions

static int get_iwnd (HWND hWnd)
 
LRESULT CALLBACK DWPTestProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void FlushMessages ()
 
static BOOL IsNext (HWND hWnd1, HWND hWnd2)
 
static void set_default_pos ()
 
static void Test_DWP_Error (HWND hWnd, HWND hWnd2)
 
static void Test_DWP_SimpleMsg (HWND hWnd1, HWND hWnd2)
 
static void Test_DWP_OwnerZOrder ()
 
 START_TEST (DeferWindowPos)
 

Variables

static HWND hWnd1
 
static HWND hWnd2
 
static HWND hWnd3
 
static HWND hWnd4
 
MSG_ENTRY move1_chain []
 
MSG_ENTRY resize1_chain []
 
MSG_ENTRY move1_2_chain []
 
MSG_ENTRY ZOrder1_chain []
 
MSG_ENTRY ZOrder1and2_chain []
 
MSG_ENTRY OwnerZOrder1A_chain []
 
MSG_ENTRY OwnerZOrder2A_chain []
 
MSG_ENTRY OwnerZOrder3A_chain []
 
MSG_ENTRY OwnerZOrder4A_chain []
 
MSG_ENTRY OwnerZOrder5A_chain []
 
MSG_ENTRY OwnerZOrder1B_chain []
 
MSG_ENTRY OwnerZOrder2B_chain []
 
MSG_ENTRY OwnerZOrder3B_chain []
 
MSG_ENTRY OwnerZOrder4B_chain []
 
MSG_ENTRY OwnerZOrder5B_chain []
 

Macro Definition Documentation

◆ EXPECT_CHAIN

#define EXPECT_CHAIN (   A,
  B,
  C,
  D 
)
Value:
EXPECT_NEXT(hWnd##B, hWnd##C); \
EXPECT_NEXT(hWnd##C, hWnd##D);
#define EXPECT_NEXT(hWnd1, hWnd2)
HWND hWnd
Definition: settings.c:17
#define D(d)
Definition: builtin.c:4557
Definition: ehthrow.cxx:93
Definition: ehthrow.cxx:54
Definition: terminate.cpp:24

Definition at line 85 of file DeferWindowPos.c.

◆ EXPECT_NEXT

#define EXPECT_NEXT (   hWnd1,
  hWnd2 
)
Value:
"After hwnd%d, expected hwnd%d not hwnd%d\n", \
static int get_iwnd(HWND hWnd)
static BOOL IsNext(HWND hWnd1, HWND hWnd2)
static HWND hWnd1
static HWND hWnd2
#define ok(value,...)
Definition: atltest.h:57
#define GW_HWNDNEXT
Definition: winuser.h:761
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)

Definition at line 80 of file DeferWindowPos.c.

◆ ok_lasterr

#define ok_lasterr (   err,
  s 
)    ok(GetLastError() == (err), "%s error = %lu\n", s, GetLastError())

Definition at line 94 of file DeferWindowPos.c.

◆ ok_windowpos

#define ok_windowpos (   hwnd,
  x,
  y,
  w,
  h,
  wnd 
)
Value:
do { RECT rt; GetWindowRect(hwnd, &rt); \
ok(rt.left == (x) && rt.top == (y) && rt.right == (x)+(w) && rt.bottom == (y)+(h), \
"Unexpected %s position: (%ld, %ld) - (%ld, %ld)\n", wnd, rt.left, rt.top, rt.right, rt.bottom); } while (0)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Definition at line 90 of file DeferWindowPos.c.

◆ OwnerZOrderAParams

#define OwnerZOrderAParams   SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOSIZE

Definition at line 366 of file DeferWindowPos.c.

◆ OwnerZOrderBParams

Definition at line 401 of file DeferWindowPos.c.

Function Documentation

◆ DWPTestProc()

LRESULT CALLBACK DWPTestProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 22 of file DeferWindowPos.c.

23{
24 int iwnd = get_iwnd(hWnd);
25
26 if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message))
28
29 switch(message)
30 {
32 case WM_IME_NOTIFY :
33 case WM_GETICON :
34 case WM_GETTEXT:
35 break;
38 {
39 WINDOWPOS* pwp = (WINDOWPOS*)lParam;
40 ok(wParam==0,"expected wParam=0\n");
42 break;
43 }
44 default:
45 RECORD_MESSAGE(iwnd, message, SENT, 0,0);
46 }
48}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static BOOL IsDWmMsg(UINT msg)
Definition: msgtrace.h:39
#define RECORD_MESSAGE(...)
Definition: msgtrace.h:60
@ SENT
Definition: msgtrace.h:6
static BOOL IseKeyMsg(UINT msg)
Definition: msgtrace.h:52
#define DefWindowProc
Definition: ros2win.h:31
UINT flags
Definition: winuser.h:3594
HWND hwndInsertAfter
Definition: winuser.h:3589
Definition: tftpd.h:60
#define WM_IME_NOTIFY
Definition: winuser.h:1830
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1661
#define WM_GETTEXT
Definition: winuser.h:1618
#define WM_IME_SETCONTEXT
Definition: winuser.h:1829
#define WM_USER
Definition: winuser.h:1895
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1662

Referenced by START_TEST().

◆ FlushMessages()

static void FlushMessages ( )
static

Definition at line 50 of file DeferWindowPos.c.

51{
52 MSG msg;
53
54 while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
55 {
56 int iwnd = get_iwnd(msg.hwnd);
57 if(!(msg.message > WM_USER || !iwnd || IsDWmMsg(msg.message) || IseKeyMsg(msg.message)))
58 RECORD_MESSAGE(iwnd, msg.message, POST,0,0);
60 }
61}
#define msg(x)
Definition: auth_time.c:54
@ POST
Definition: msgtrace.h:7
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define PM_REMOVE
Definition: winuser.h:1196
#define PeekMessage
Definition: winuser.h:5839

Referenced by set_default_pos(), Test_DWP_Error(), Test_DWP_OwnerZOrder(), and Test_DWP_SimpleMsg().

◆ get_iwnd()

static int get_iwnd ( HWND  hWnd)
static

Definition at line 13 of file DeferWindowPos.c.

14{
15 if(hWnd == hWnd1) return 1;
16 else if(hWnd == hWnd2) return 2;
17 else if(hWnd == hWnd3) return 3;
18 else if(hWnd == hWnd4) return 4;
19 else return 0;
20}
static HWND hWnd4
static HWND hWnd3

Referenced by DWPTestProc(), and FlushMessages().

◆ IsNext()

static BOOL IsNext ( HWND  hWnd1,
HWND  hWnd2 
)
static

Definition at line 65 of file DeferWindowPos.c.

66{
67 HWND hWndNext;
68
69 hWndNext=hWnd1;
70 while((hWndNext = GetWindow(hWndNext,GW_HWNDNEXT)))
71 {
72 if(hWndNext == hWnd2)
73 {
74 return TRUE;
75 }
76 }
77 return FALSE;
78}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

◆ set_default_pos()

static void set_default_pos ( )
static

Definition at line 96 of file DeferWindowPos.c.

97{
104 EMPTY_CACHE();
105}
static void FlushMessages()
#define EMPTY_CACHE()
Definition: msgtrace.h:59
#define SWP_NOACTIVATE
Definition: winuser.h:1242
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HWND WINAPI SetActiveWindow(_In_ HWND)
#define SWP_SHOWWINDOW
Definition: winuser.h:1248
#define SWP_NOOWNERZORDER
Definition: winuser.h:1249

Referenced by START_TEST(), and Test_DWP_OwnerZOrder().

◆ START_TEST()

START_TEST ( DeferWindowPos  )

Definition at line 496 of file DeferWindowPos.c.

497{
498 SetCursorPos(0,0);
499
500 RegisterSimpleClass(DWPTestProc, L"ownertest");
501 hWnd1 = CreateWindowExW(0, L"ownertest", L"abc", 0, 10, 20,
502 200, 210, NULL, NULL, 0, NULL);
503 hWnd2 = CreateWindowExW(0, L"ownertest", L"def", 0, 30, 40,
504 220, 230, NULL, NULL, 0, NULL);
505 hWnd3 = CreateWindowW(L"ownertest", L"ownertest", WS_OVERLAPPEDWINDOW,
506 20, 350, 300, 300, hWnd1, NULL, 0, NULL);
507 hWnd4 = CreateWindowW(L"ownertest", L"ownertest", WS_OVERLAPPEDWINDOW,
508 250, 250, 200, 200, hWnd1, NULL, 0, NULL);
509
510 ok(hWnd1 != NULL, "CreateWindow failed\n");
511 ok(hWnd2 != NULL, "CreateWindow failed\n");
512 ok(hWnd3 != NULL, "CreateWindow failed\n");
513 ok(hWnd4 != NULL, "CreateWindow failed\n");
514
517
520
523
528 }
static void Test_DWP_Error(HWND hWnd, HWND hWnd2)
static void Test_DWP_SimpleMsg(HWND hWnd1, HWND hWnd2)
static void set_default_pos()
LRESULT CALLBACK DWPTestProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
static void Test_DWP_OwnerZOrder()
#define NULL
Definition: types.h:112
#define L(x)
Definition: ntvdm.h:50
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
static __inline ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2706
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)
Definition: winuser.h:4316
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ Test_DWP_Error()

static void Test_DWP_Error ( HWND  hWnd,
HWND  hWnd2 
)
static

Definition at line 107 of file DeferWindowPos.c.

108{
109 HDWP hDwp;
110 BOOL ret;
111
112 ok_windowpos(hWnd1, 10, 20, 200, 210, "Window 1");
113 ok_windowpos(hWnd2, 30, 40, 220, 230, "Window 2");
114
115 /* close invalid handles */
118 ok(ret == 0, "EndDeferWindowPos succeeded with invalid handle\n");
119 ok_lasterr(ERROR_INVALID_DWP_HANDLE, "EndDeferWindowPos");
120
122 ret = EndDeferWindowPos((HDWP)-1);
123 ok(ret == 0, "EndDeferWindowPos succeeded with invalid handle\n");
124 ok_lasterr(ERROR_INVALID_DWP_HANDLE, "EndDeferWindowPos");
125
126 /* negative window count */
128 hDwp = BeginDeferWindowPos(-1);
129 ok(hDwp == NULL, "BeginDeferWindowPos failed\n");
130 ok_lasterr(ERROR_INVALID_PARAMETER, "BeginDeferWindowPos");
131
132 /* zero windows */
134 hDwp = BeginDeferWindowPos(0);
135 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
136 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
137 ret = EndDeferWindowPos(hDwp);
138 ok(ret != 0, "EndDeferWindowPos failed\n");
139 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "EndDeferWindowPos");
140
141 /* more windows than expected */
143 hDwp = BeginDeferWindowPos(0);
144 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
145 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
146 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
147 ok(hDwp != NULL, "DeferWindowPos failed\n");
148 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
149 ret = EndDeferWindowPos(hDwp);
150 ok(ret != 0, "EndDeferWindowPos failed\n");
151 ok(GetLastError() == ERROR_SUCCESS /* win7 sp1/x64 */
152 || GetLastError() == ERROR_INVALID_WINDOW_HANDLE /* 2k3 sp1/x86 */,
153 "EndDeferWindowPos error = %lu\n", GetLastError());
154 ok_windowpos(hWnd, 10, 20, 200, 210, "Window 1");
155
156 /* more windows than expected 2 */
158 hDwp = BeginDeferWindowPos(1);
159 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
160 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
161 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 30, 20, 190, 195, SWP_NOZORDER);
162 ok(hDwp != NULL, "DeferWindowPos failed\n");
163 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
164 hDwp = DeferWindowPos(hDwp, hWnd2, NULL, 20, 30, 195, 190, SWP_NOZORDER);
165 ok(hDwp != NULL, "DeferWindowPos failed\n");
166 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
167 ret = EndDeferWindowPos(hDwp);
168 ok(ret != 0, "EndDeferWindowPos failed\n");
169 ok_lasterr(ERROR_SUCCESS, "EndDeferWindowPos");
170 ok_windowpos(hWnd, 30, 20, 190, 195, "Window 1");
171 ok_windowpos(hWnd2, 20, 30, 195, 190, "Window 2");
172
173 /* fewer windows than expected */
174 MoveWindow(hWnd, 10, 20, 200, 210, FALSE);
176 hDwp = BeginDeferWindowPos(2);
177 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
178 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
179 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 20, 10, 210, 200, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
180 ok(hDwp != NULL, "DeferWindowPos failed\n");
181 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
182 ret = EndDeferWindowPos(hDwp);
183 ok(ret != 0, "EndDeferWindowPos failed\n");
184 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "EndDeferWindowPos");
185 ok_windowpos(hWnd, 10, 20, 200, 210, "Window 1");
186
187 /* no operation, 1 window */
189 hDwp = BeginDeferWindowPos(1);
190 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
191 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
192 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 20, 10, 210, 200, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
193 ok(hDwp != NULL, "DeferWindowPos failed\n");
194 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
195 ret = EndDeferWindowPos(hDwp);
196 ok(ret != 0, "EndDeferWindowPos failed\n");
197 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "EndDeferWindowPos");
198 ok_windowpos(hWnd, 10, 20, 200, 210, "Window 1");
199
200 /* same window twice */
202 hDwp = BeginDeferWindowPos(2);
203 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
204 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
205 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 80, 90, 220, 210, SWP_NOZORDER);
206 ok(hDwp != NULL, "DeferWindowPos failed\n");
207 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
208 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 100, 110, 230, 250, SWP_NOZORDER);
209 ok(hDwp != NULL, "DeferWindowPos failed\n");
210 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
211 ret = EndDeferWindowPos(hDwp);
212 ok(ret != 0, "EndDeferWindowPos failed\n");
213 ok_lasterr(ERROR_SUCCESS, "EndDeferWindowPos");
214 ok_windowpos(hWnd, 100, 110, 230, 250, "Window 1");
215
216 /* move & resize operation, 1 window */
218 hDwp = BeginDeferWindowPos(1);
219 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
220 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
221 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 20, 10, 210, 200, SWP_NOZORDER);
222 ok(hDwp != NULL, "DeferWindowPos failed\n");
223 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
224 ret = EndDeferWindowPos(hDwp);
225 ok(ret != 0, "EndDeferWindowPos failed\n");
226 ok_lasterr(ERROR_SUCCESS, "EndDeferWindowPos");
227 ok_windowpos(hWnd, 20, 10, 210, 200, "Window 1");
228
229 /* move & resize operation, 2 windows */
231 hDwp = BeginDeferWindowPos(2);
232 ok(hDwp != NULL, "BeginDeferWindowPos failed\n");
233 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "BeginDeferWindowPos");
234 hDwp = DeferWindowPos(hDwp, hWnd, NULL, 50, 60, 230, 240, SWP_NOZORDER);
235 ok(hDwp != NULL, "DeferWindowPos failed\n");
236 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
237 hDwp = DeferWindowPos(hDwp, hWnd2, NULL, 70, 80, 250, 260, SWP_NOZORDER);
238 ok(hDwp != NULL, "DeferWindowPos failed\n");
239 ok_lasterr(DNS_ERROR_RCODE_NXRRSET, "DeferWindowPos");
240 ret = EndDeferWindowPos(hDwp);
241 ok(ret != 0, "EndDeferWindowPos failed\n");
242 ok_lasterr(ERROR_SUCCESS, "EndDeferWindowPos");
243 ok_windowpos(hWnd, 50, 60, 230, 240, "Window 1");
244 ok_windowpos(hWnd2, 70, 80, 250, 260, "Window 2");
245
247 EMPTY_CACHE();
248}
#define ok_windowpos(hwnd, x, y, w, h, wnd)
#define ok_lasterr(err, s)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
unsigned int BOOL
Definition: ntddk_ex.h:94
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ERROR_INVALID_DWP_HANDLE
Definition: winerror.h:886
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define DNS_ERROR_RCODE_NXRRSET
Definition: winerror.h:1855
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SWP_NOSIZE
Definition: winuser.h:1245
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1247
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
HDWP WINAPI BeginDeferWindowPos(_In_ int)

Referenced by START_TEST().

◆ Test_DWP_OwnerZOrder()

static void Test_DWP_OwnerZOrder ( )
static

Definition at line 428 of file DeferWindowPos.c.

429{
430 EXPECT_CHAIN(4,3,1,2);
431
432 /* test how SetWindowPos can change the z order of owner windows */
433 /* note that SWP_NOACTIVATE must be used because otherwise
434 SetWindowPos will call SetWindowPos again with different parameters */
438 EXPECT_CHAIN(4,3,1,2);
439
443 EXPECT_CHAIN(2,4,3,1);
444
448 EXPECT_CHAIN(3,4,1,2);
449
453 EXPECT_CHAIN(3,4,1,2);
454
458 EXPECT_CHAIN(4,3,1,2);
459
460 /* now do the same thing one more time with SWP_NOOWNERZORDER */
461 /* SWP_NOACTIVATE is needed because without it SetActiveWindow
462 will be calledit and it will call SetWindowPos again
463 WITHOUT SWP_NOOWNERZORDER. that means that
464 in order for SWP_NOOWNERZORDER to have effect we have to use
465 SWP_NOACTIVATE as well */
467 EXPECT_CHAIN(4,3,2,1);
468
472 EXPECT_CHAIN(1,4,3,2);
473
477 EXPECT_CHAIN(2,1,4,3);
478
482 EXPECT_CHAIN(3,2,1,4);
483
487 EXPECT_CHAIN(1,3,2,4);
488
492 EXPECT_CHAIN(4,1,3,2);
493
494}
MSG_ENTRY OwnerZOrder4A_chain[]
MSG_ENTRY OwnerZOrder5B_chain[]
#define OwnerZOrderAParams
MSG_ENTRY OwnerZOrder5A_chain[]
#define EXPECT_CHAIN(A, B, C, D)
MSG_ENTRY OwnerZOrder3B_chain[]
MSG_ENTRY OwnerZOrder1B_chain[]
MSG_ENTRY OwnerZOrder1A_chain[]
#define OwnerZOrderBParams
MSG_ENTRY OwnerZOrder2A_chain[]
MSG_ENTRY OwnerZOrder4B_chain[]
MSG_ENTRY OwnerZOrder2B_chain[]
MSG_ENTRY OwnerZOrder3A_chain[]
#define COMPARE_CACHE(msg_chain)
Definition: msgtrace.h:57

Referenced by START_TEST().

◆ Test_DWP_SimpleMsg()

static void Test_DWP_SimpleMsg ( HWND  hWnd1,
HWND  hWnd2 
)
static

Definition at line 290 of file DeferWindowPos.c.

291{
292 HDWP hdwp;
293 BOOL ret;
294
295 SetWindowPos(hWnd1, 0, 10,20,100,100,0);
296 SetWindowPos(hWnd2, 0, 10,20,100,100,0);
298 EMPTY_CACHE();
299
300 /* move hWnd1 */
301 hdwp = BeginDeferWindowPos(1);
302 ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
303 hdwp = DeferWindowPos(hdwp, hWnd1, HWND_TOP, 20, 30, 100, 100, SWP_NOACTIVATE|SWP_NOOWNERZORDER);
304 ok(hdwp != NULL, "DeferWindowPos failed\n");
307 ret = EndDeferWindowPos(hdwp);
308 ok(ret != 0, "EndDeferWindowPos failed\n");
311
312 /* resize hWnd1 */
313 hdwp = BeginDeferWindowPos(1);
314 ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
315 hdwp = DeferWindowPos(hdwp, hWnd1, HWND_TOP, 20, 30, 110, 110, SWP_NOACTIVATE|SWP_NOOWNERZORDER);
316 ok(hdwp != NULL, "DeferWindowPos failed\n");
319 ret = EndDeferWindowPos(hdwp);
320 ok(ret != 0, "EndDeferWindowPos failed\n");
323
324 /* move both windows */
325 hdwp = BeginDeferWindowPos(1);
326 ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
327 hdwp = DeferWindowPos(hdwp, hWnd1, HWND_TOP, 30, 40, 110, 110, SWP_NOACTIVATE|SWP_NOOWNERZORDER);
328 ok(hdwp != NULL, "DeferWindowPos failed\n");
329 hdwp = DeferWindowPos(hdwp, hWnd2, HWND_TOP, 30, 40, 100, 100, SWP_NOACTIVATE|SWP_NOOWNERZORDER);
330 ok(hdwp != NULL, "DeferWindowPos failed\n");
333 ret = EndDeferWindowPos(hdwp);
334 ok(ret != 0, "EndDeferWindowPos failed\n");
337
338 /* change the z-order of the first window */
339 hdwp = BeginDeferWindowPos(1);
340 ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
342 ok(hdwp != NULL, "DeferWindowPos failed\n");
345 ret = EndDeferWindowPos(hdwp);
346 ok(ret != 0, "EndDeferWindowPos failed\n");
349
350 /* change the z-order of both windows */
351 hdwp = BeginDeferWindowPos(2);
352 ok(hdwp != NULL, "BeginDeferWindowPos failed\n");
354 ok(hdwp != NULL, "DeferWindowPos failed\n");
356 ok(hdwp != NULL, "DeferWindowPos failed\n");
359 ret = EndDeferWindowPos(hdwp);
360 ok(ret != 0, "EndDeferWindowPos failed\n");
363
364}
MSG_ENTRY move1_2_chain[]
MSG_ENTRY resize1_chain[]
MSG_ENTRY move1_chain[]
MSG_ENTRY ZOrder1and2_chain[]
MSG_ENTRY ZOrder1_chain[]
MSG_ENTRY empty_chain[]
Definition: msgtrace.c:20
#define HWND_TOP
Definition: winuser.h:1207
#define HWND_BOTTOM
Definition: winuser.h:1205

Referenced by START_TEST().

Variable Documentation

◆ hWnd1

◆ hWnd2

◆ hWnd3

HWND hWnd3
static

◆ hWnd4

HWND hWnd4
static

Definition at line 10 of file DeferWindowPos.c.

Referenced by get_iwnd(), set_default_pos(), START_TEST(), and Test_DWP_OwnerZOrder().

◆ move1_2_chain

◆ move1_chain

◆ OwnerZOrder1A_chain

MSG_ENTRY OwnerZOrder1A_chain[]

◆ OwnerZOrder1B_chain

MSG_ENTRY OwnerZOrder1B_chain[]
Initial value:

Definition at line 403 of file DeferWindowPos.c.

Referenced by Test_DWP_OwnerZOrder().

◆ OwnerZOrder2A_chain

MSG_ENTRY OwnerZOrder2A_chain[]

◆ OwnerZOrder2B_chain

MSG_ENTRY OwnerZOrder2B_chain[]

◆ OwnerZOrder3A_chain

◆ OwnerZOrder3B_chain

MSG_ENTRY OwnerZOrder3B_chain[]

◆ OwnerZOrder4A_chain

MSG_ENTRY OwnerZOrder4A_chain[]

◆ OwnerZOrder4B_chain

MSG_ENTRY OwnerZOrder4B_chain[]

◆ OwnerZOrder5A_chain

◆ OwnerZOrder5B_chain

MSG_ENTRY OwnerZOrder5B_chain[]

◆ resize1_chain

MSG_ENTRY resize1_chain[]
Initial value:

Definition at line 257 of file DeferWindowPos.c.

Referenced by Test_DWP_SimpleMsg().

◆ ZOrder1_chain

◆ ZOrder1and2_chain