ReactOS 0.4.16-dev-13-ge2fc578
RedrawWindow.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS API tests
3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4 * PURPOSE: Test for RedrawWindow
5 * COPYRIGHT: Copyright 2018 Thomas Faber <thomas.faber@reactos.org>
6 * Copyright 2024 Tomáš Veselý <turican0@gmail.com>
7 */
8
9#include "precomp.h"
10
13
16int paintIndex = 0;
17const wchar_t CHILD_CLASS_NAME[] = L"ChildWindowClass";
18
19static
27{
29 ok(GetCurrentThreadId() == dwThreadId, "Thread 0x%lx instead of 0x%lx\n", GetCurrentThreadId(), dwThreadId);
30 if (message == WM_PAINT)
31 {
33 }
35}
36
38{
39 HWND hWnd;
40 MSG msg;
41 HRGN hRgn;
42 BOOL ret;
43 int i;
44
45 SetCursorPos(0,0);
46
48 RegisterSimpleClass(WndProc, L"CreateTest");
49
50 hWnd = CreateWindowExW(0, L"CreateTest", NULL, 0, 10, 10, 20, 20, NULL, NULL, 0, NULL);
51 ok(hWnd != NULL, "CreateWindow failed\n");
52
54
55 while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
56 {
58 }
59
60 ok(got_paint == TRUE, "Did not process WM_PAINT message\n");
62
63 hRgn = CreateRectRgn(0, 0, 1, 1);
64 ok(hRgn != NULL, "CreateRectRgn failed\n");
66 ok(ret == TRUE, "RedrawWindow failed\n");
67
68 i = 0;
69 while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
70 {
71 RECORD_MESSAGE(1, msg.message, POST, 0, 0);
72 if (msg.message == WM_PAINT)
73 {
74 i++;
75 if (i == 10)
76 {
77 ok(got_paint == FALSE, "Received unexpected WM_PAINT message\n");
78 }
79 }
80 if (msg.message != WM_PAINT || i >= 10)
81 {
83 }
84 }
85
86 ok(i == 10, "Received %d WM_PAINT messages\n", i);
87 ok(got_paint == TRUE, "Did not process WM_PAINT message\n");
88
90
93}
94
96{
97 HBRUSH hBrush = CreateSolidBrush(color);
98 FillRect(hdc, rect, hBrush);
99 DeleteObject(hBrush);
100
102 SetTextColor(hdc, RGB(255, 255, 255));
103 DrawTextW(hdc, L"Test RedrawWindow", -1, rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
104}
105
107{
108 switch (uMsg)
109 {
110 case WM_DESTROY:
111 {
113 return 0;
114 }
115 case WM_PAINT:
116 {
117 PAINTSTRUCT ps;
118 HDC hdc = BeginPaint(hwnd, &ps);
119 RECT rect;
121 DrawContent(hdc, &rect, RGB(0, 255, 0));
122 EndPaint(hwnd, &ps);
123 paintIndex++;
124 return 0;
125 }
126 case WM_ERASEBKGND:
127 {
128 if(paintIndex != 0)
130 return 0;
131 }
132 case WM_NCPAINT:
133 {
134 if (paintIndex != 0)
136 return 0;
137 }
138 }
139 return DefWindowProc(hwnd, uMsg, wParam, lParam);
140}
141
143{
144 switch (uMsg) {
145 case WM_SYNCPAINT:
146 {
147 PAINTSTRUCT ps;
148 HDC hdc = BeginPaint(hwnd, &ps);
149 HBRUSH brush = CreateSolidBrush(RGB(0, 0, 255));
150 FillRect(hdc, &ps.rcPaint, brush);
151 DeleteObject(brush);
152 EndPaint(hwnd, &ps);
153 break;
154 }
155 case WM_PAINT:
156 {
157 PAINTSTRUCT ps;
158 HDC hdc = BeginPaint(hwnd, &ps);
159 HBRUSH brush = CreateSolidBrush(RGB(0, 0, 255));
160 FillRect(hdc, &ps.rcPaint, brush);
161 DeleteObject(brush);
162 EndPaint(hwnd, &ps);
163 break;
164 }
165 case WM_DESTROY:
166 {
168 return 0;
169 }
170 }
171 return DefWindowProc(hwnd, uMsg, wParam, lParam);
172}
173
175{
176 const wchar_t* testName;
204
206{
217
218void ServeSomeMessages(int messageTime, int messageCount)
219{
221
222 MSG msg = { 0 };
224 while (GetTickCount() - startTime < messageTime * messageCount)
225 {
226 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
227 {
230 }
231 else
232 {
233 Sleep(messageTime);
234 }
235 }
236}
237
239 DWORD style;
240 int width;
241 int height;
242 HWND hChildWnd = NULL;
243 HRGN RgnUpdate;
244 RECT* prect;
245
248 paintIndex = 0;
249
250 WNDCLASSW wc = { 0 };
253 wc.lpszClassName = ptestRW->testName;
254 RegisterClassW(&wc);
255 RECT rectWin = { 0, 0, 800, 600 };
257 AdjustWindowRectEx(&rectWin, style, FALSE, 0);
258 width = rectWin.right - rectWin.left;
259 height = rectWin.bottom - rectWin.top;
262 if (hwnd == NULL)
263 return;
264
266 if(!ptestRW->testChild)
268
269 if (ptestRW->testChild)
270 {
271 WNDCLASSW wcChild = { 0 };
273 wcChild.hInstance = GetModuleHandle(NULL);
275 RegisterClassW(&wcChild);
276
277 hChildWnd = CreateWindowExW(
278 0,
280 L"Child Window",
282 10, 10, 200, 200,
283 hwnd,
284 NULL,
286 NULL
287 );
288 }
289
290 HDC hdc = GetDC(hwnd);
291 RECT drect = { 0, 0, 800, 600 };
292 DrawContent(hdc, &drect, RGB(255, 0, 0));
294
295 RgnUpdate = NULL;
296 if (ptestRW->useRegion)
297 {
298 RgnUpdate = CreateRectRgn(ptestRW->regRect.left, ptestRW->regRect.top, ptestRW->regRect.right, ptestRW->regRect.bottom);
299 }
300
301 prect=NULL;
302 if (ptestRW->useRect)
303 {
304 prect = &ptestRW->rectRect;
305 }
306
307 if (ptestRW->testChild)
308 {
309 ServeSomeMessages(10, 10);
310 }
311
312 ptestRW->resultRedraw = RedrawWindow(hwnd, prect, RgnUpdate, ptestRW->flags);
313
314 if (ptestRW->testChild)
315 {
316 ServeSomeMessages(10, 10);
317 }
318
319 hdc = GetDC(hwnd);
320 ptestRW->resultColorPre1 = GetPixel(hdc, ptestRW->testPixelPre1x, ptestRW->testPixelPre1y);
321 ptestRW->resultColorPre2 = GetPixel(hdc, ptestRW->testPixelPre2x, ptestRW->testPixelPre2y);
323
325
326 if (ptestRW->forcePaint)
327 {
329 }
330
331 hdc = GetDC(hwnd);
332 ptestRW->resultColorPost1 = GetPixel(hdc, ptestRW->testPixelPost1x, ptestRW->testPixelPost1y);
333 ptestRW->resultColorPost2 = GetPixel(hdc, ptestRW->testPixelPost2x, ptestRW->testPixelPost2y);
335
338 ptestRW->resultPaintIndex = paintIndex;
339
340 if (RgnUpdate) DeleteObject(RgnUpdate);
341
342 if (hChildWnd != NULL)
343 DestroyWindow(hChildWnd);
344 if (hwnd != NULL)
346}
347
349{
350 UINT countErrors = 0;
351
352 TestRedrawWindow(ptestRW);
353
354 if (ptestRW->resultRedraw)
355 {
356 if (ptestRWcompare->resultColorPre1 != ptestRW->resultColorPre1)
357 {
358 trace("DIFFERENCE-resultColorPre1 0x%06x 0x%06x\n", (int)ptestRW->resultColorPre1, (int)ptestRWcompare->resultColorPre1);
359 countErrors++;
360 }
361 if (ptestRWcompare->resultColorPre2 != ptestRW->resultColorPre2)
362 {
363 trace("DIFFERENCE-resultColorPre2 0x%06x 0x%06x\n", (int)ptestRW->resultColorPre2, (int)ptestRWcompare->resultColorPre2);
364 countErrors++;
365 }
366 if (ptestRWcompare->resultColorPost1 != ptestRW->resultColorPost1)
367 {
368 trace("DIFFERENCE-resultColorPost1 0x%06x 0x%06x\n", (int)ptestRW->resultColorPost1, (int)ptestRWcompare->resultColorPost1);
369 countErrors++;
370 }
371 if (ptestRWcompare->resultColorPost2 != ptestRW->resultColorPost2)
372 {
373 trace("DIFFERENCE-resultColorPost2 0x%06x 0x%06x\n", (int)ptestRW->resultColorPost2, (int)ptestRWcompare->resultColorPost2);
374 countErrors++;
375 }
376 if (ptestRWcompare->resultNeedsUpdate != ptestRW->resultNeedsUpdate)
377 {
378 trace("DIFFERENCE-resultNeedsUpdate %d %d\n", ptestRW->resultNeedsUpdate, ptestRWcompare->resultNeedsUpdate);
379 countErrors++;
380 }
381 if (ptestRW->resultNeedsUpdate)
382 {
383 if (ptestRWcompare->resultUpdateRect.left != ptestRW->resultUpdateRect.left)
384 {
385 trace("DIFFERENCE-resultUpdateRect.left %d %d\n", (int)ptestRW->resultUpdateRect.left, (int)ptestRWcompare->resultUpdateRect.left);
386 countErrors++;
387 }
388 if (ptestRWcompare->resultUpdateRect.top != ptestRW->resultUpdateRect.top)
389 {
390 trace("DIFFERENCE-resultUpdateRect.top %d %d\n", (int)ptestRW->resultUpdateRect.top, (int)ptestRWcompare->resultUpdateRect.top);
391 countErrors++;
392 }
393 if (ptestRWcompare->resultUpdateRect.right != ptestRW->resultUpdateRect.right)
394 {
395 trace("DIFFERENCE-resultUpdateRect.right %d %d\n", (int)ptestRW->resultUpdateRect.right, (int)ptestRWcompare->resultUpdateRect.right);
396 countErrors++;
397 }
398 if (ptestRWcompare->resultUpdateRect.bottom != ptestRW->resultUpdateRect.bottom)
399 {
400 trace("DIFFERENCE-resultUpdateRect.bottom %d %d\n", (int)ptestRW->resultUpdateRect.bottom, (int)ptestRWcompare->resultUpdateRect.bottom);
401 countErrors++;
402 }
403 }
404 if (ptestRWcompare->resultWmEraseGnd != ptestRW->resultWmEraseGnd)
405 {
406 trace("DIFFERENCE-resultWmEraseGnd %d %d\n", ptestRW->resultWmEraseGnd, ptestRWcompare->resultWmEraseGnd);
407 countErrors++;
408 }
409 if (ptestRWcompare->resultWmNcPaint != ptestRW->resultWmNcPaint)
410 {
411 trace("DIFFERENCE-resultWmNcPaint %d %d\n", ptestRW->resultWmNcPaint, ptestRWcompare->resultWmNcPaint);
412 countErrors++;
413 }
414 if (ptestRWcompare->resultPaintIndex != ptestRW->resultPaintIndex)
415 {
416 trace("DIFFERENCE-resultPaintIndex %d %d\n", ptestRW->resultPaintIndex, ptestRWcompare->resultPaintIndex);
417 countErrors++;
418 }
419 }
420 if (countErrors > 0)
421 {
422 trace("COUNT OF DIFFERENCES - %d\n", countErrors);
423 }
424
425 return countErrors;
426}
427
428void InitRect(RECT *rect, int left, int top, int right, int bottom) {
429 rect->left = left;
430 rect->top = top;
431 rect->right = right;
432 rect->bottom = bottom;
433}
434
436{
438 STRUCT_TestRedrawWindowCompare testRWcompare;
439
440 testRW.testPixelPre1x = 50;
441 testRW.testPixelPre1y = 50;
442 testRW.testPixelPre2x = 50;
443 testRW.testPixelPre2y = 550;
444 testRW.testPixelPost1x = 50;
445 testRW.testPixelPost1y = 50;
446 testRW.testPixelPost2x = 50;
447 testRW.testPixelPost2y = 550;
448
449 // RDW_ERASE tests
450 testRW.testName = L"Test1";
451 testRW.flags = 0;
452 testRW.useRegion = TRUE;
453 InitRect(&testRW.regRect, 0, 500, 800, 600);
454 testRW.useRect = FALSE;
455 InitRect(&testRW.rectRect, 0, 0, 200, 200);
456 testRW.forcePaint = TRUE;
457 testRW.testChild = FALSE;
458
459 testRWcompare.resultColorPre1 = 0x000000FF;
460 testRWcompare.resultColorPre2 = 0x000000FF;
461 testRWcompare.resultColorPost1 = 0x000000FF;
462 testRWcompare.resultColorPost2 = 0x000000FF;
463 InitRect(&testRWcompare.resultUpdateRect, 0, 0, 200, 200);
464 testRWcompare.resultNeedsUpdate = FALSE;
465 testRWcompare.resultWmEraseGnd = FALSE;
466 testRWcompare.resultWmNcPaint = FALSE;
467 testRWcompare.resultPaintIndex = 1;
468 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test1 fail\n");
469
470 testRW.testName = L"Test2";
471 testRW.flags = RDW_ERASE;
472 testRW.useRegion = TRUE;
473 InitRect(&testRW.regRect, 0, 500, 800, 600);
474 testRW.useRect = FALSE;
475 InitRect(&testRW.rectRect, 0, 0, 200, 200);
476 testRW.forcePaint = TRUE;
477 testRW.testChild = FALSE;
478
479 testRWcompare.resultColorPre1 = 0x000000FF;
480 testRWcompare.resultColorPre2 = 0x000000FF;
481 testRWcompare.resultColorPost1 = 0x000000FF;
482 testRWcompare.resultColorPost2 = 0x000000FF;
483 InitRect(&testRWcompare.resultUpdateRect, 0, 0, 200, 200);
484 testRWcompare.resultNeedsUpdate = FALSE;
485 testRWcompare.resultWmEraseGnd = FALSE;
486 testRWcompare.resultWmNcPaint = FALSE;
487 testRWcompare.resultPaintIndex = 1;
488 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test2 fail\n");
489
490 testRW.testName = L"Test3";
491 testRW.flags = RDW_INVALIDATE;
492 testRW.useRegion = TRUE;
493 InitRect(&testRW.regRect, 0, 500, 800, 600);
494 testRW.useRect = FALSE;
495 InitRect(&testRW.rectRect, 0, 0, 200, 200);
496 testRW.forcePaint = TRUE;
497 testRW.testChild = FALSE;
498
499 testRWcompare.resultColorPre1 = 0x000000FF;
500 testRWcompare.resultColorPre2 = 0x000000FF;
501 testRWcompare.resultColorPost1 = 0x000000FF;
502 testRWcompare.resultColorPost2 = 0x0000FF00;
503 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
504 testRWcompare.resultNeedsUpdate = TRUE;
505 testRWcompare.resultWmEraseGnd = FALSE;
506 testRWcompare.resultWmNcPaint = FALSE;
507 testRWcompare.resultPaintIndex = 2;
508 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test3 fail\n");
509
510 testRW.testName = L"Test4";
511 testRW.flags = RDW_INVALIDATE | RDW_ERASE;
512 testRW.useRegion = TRUE;
513 InitRect(&testRW.regRect, 0, 500, 800, 600);
514 testRW.useRect = FALSE;
515 InitRect(&testRW.rectRect, 0, 0, 200, 200);
516 testRW.forcePaint = TRUE;
517 testRW.testChild = FALSE;
518
519 testRWcompare.resultColorPre1 = 0x000000FF;
520 testRWcompare.resultColorPre2 = 0x000000FF;
521 testRWcompare.resultColorPost1 = 0x000000FF;
522 testRWcompare.resultColorPost2 = 0x0000FF00;
523 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
524 testRWcompare.resultNeedsUpdate = TRUE;
525 testRWcompare.resultWmEraseGnd = TRUE;
526 testRWcompare.resultWmNcPaint = FALSE;
527 testRWcompare.resultPaintIndex = 2;
528 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test4 fail\n");
529
530 // RDW_FRAME tests
531 testRW.testName = L"Test5";
532 testRW.flags = RDW_FRAME;
533 testRW.useRegion = TRUE;
534 InitRect(&testRW.regRect, 0, 500, 800, 600);
535 testRW.useRect = FALSE;
536 InitRect(&testRW.rectRect, 0, 0, 200, 200);
537 testRW.forcePaint = TRUE;
538 testRW.testChild = FALSE;
539
540 testRWcompare.resultColorPre1 = 0x000000FF;
541 testRWcompare.resultColorPre2 = 0x000000FF;
542 testRWcompare.resultColorPost1 = 0x000000FF;
543 testRWcompare.resultColorPost2 = 0x000000FF;
544 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
545 testRWcompare.resultNeedsUpdate = FALSE;
546 testRWcompare.resultWmEraseGnd = FALSE;
547 testRWcompare.resultWmNcPaint = FALSE;
548 testRWcompare.resultPaintIndex = 1;
549 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test5 fail\n");
550
551 testRW.testName = L"Test6";
552 testRW.flags = RDW_INVALIDATE | RDW_FRAME;
553 testRW.useRegion = TRUE;
554 InitRect(&testRW.regRect, 0, 500, 800, 600);
555 testRW.useRect = FALSE;
556 InitRect(&testRW.rectRect, 0, 0, 200, 200);
557 testRW.forcePaint = TRUE;
558 testRW.testChild = FALSE;
559
560 testRWcompare.resultColorPre1 = 0x000000FF;
561 testRWcompare.resultColorPre2 = 0x000000FF;
562 testRWcompare.resultColorPost1 = 0x000000FF;
563 testRWcompare.resultColorPost2 = 0x0000FF00;
564 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
565 testRWcompare.resultNeedsUpdate = TRUE;
566 testRWcompare.resultWmEraseGnd = FALSE;
567 testRWcompare.resultWmNcPaint = TRUE;
568 testRWcompare.resultPaintIndex = 2;
569 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test6 fail\n");
570
571 // RDW_INTERNALPAINT tests
572 testRW.testName = L"Test7";
573 testRW.flags = RDW_INTERNALPAINT;
574 testRW.useRegion = TRUE;
575 InitRect(&testRW.regRect, 0, 500, 800, 600);
576 testRW.useRect = FALSE;
577 InitRect(&testRW.rectRect, 0, 0, 200, 200);
578 testRW.forcePaint = TRUE;
579 testRW.testChild = FALSE;
580
581 testRWcompare.resultColorPre1 = 0x000000FF;
582 testRWcompare.resultColorPre2 = 0x000000FF;
583 testRWcompare.resultColorPost1 = 0x000000FF;
584 testRWcompare.resultColorPost2 = 0x000000FF;
585 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
586 testRWcompare.resultNeedsUpdate = FALSE;
587 testRWcompare.resultWmEraseGnd = FALSE;
588 testRWcompare.resultWmNcPaint = FALSE;
589 testRWcompare.resultPaintIndex = 2;
590 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test7 fail\n");
591
592 testRW.testName = L"Test8";
594 testRW.useRegion = TRUE;
595 InitRect(&testRW.regRect, 0, 500, 800, 600);
596 testRW.useRect = FALSE;
597 InitRect(&testRW.rectRect, 0, 0, 200, 200);
598 testRW.forcePaint = TRUE;
599 testRW.testChild = FALSE;
600
601 testRWcompare.resultColorPre1 = 0x000000FF;
602 testRWcompare.resultColorPre2 = 0x000000FF;
603 testRWcompare.resultColorPost1 = 0x000000FF;
604 testRWcompare.resultColorPost2 = 0x0000FF00;
605 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
606 testRWcompare.resultNeedsUpdate = TRUE;
607 testRWcompare.resultWmEraseGnd = FALSE;
608 testRWcompare.resultWmNcPaint = FALSE;
609 testRWcompare.resultPaintIndex = 2;
610 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test8 fail\n");
611
612 // RDW_NOERASE tests
613 testRW.testName = L"Test9";
614 testRW.flags = RDW_NOERASE;
615 testRW.useRegion = TRUE;
616 InitRect(&testRW.regRect, 0, 500, 800, 600);
617 testRW.useRect = FALSE;
618 InitRect(&testRW.rectRect, 0, 0, 200, 200);
619 testRW.forcePaint = TRUE;
620 testRW.testChild = FALSE;
621
622 testRWcompare.resultColorPre1 = 0x000000FF;
623 testRWcompare.resultColorPre2 = 0x000000FF;
624 testRWcompare.resultColorPost1 = 0x000000FF;
625 testRWcompare.resultColorPost2 = 0x000000FF;
626 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
627 testRWcompare.resultNeedsUpdate = FALSE;
628 testRWcompare.resultWmEraseGnd = FALSE;
629 testRWcompare.resultWmNcPaint = FALSE;
630 testRWcompare.resultPaintIndex = 1;
631 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test9 fail\n");
632
633 testRW.testName = L"Test10";
635 testRW.useRegion = TRUE;
636 InitRect(&testRW.regRect, 0, 500, 800, 600);
637 testRW.useRect = FALSE;
638 InitRect(&testRW.rectRect, 0, 0, 200, 200);
639 testRW.forcePaint = TRUE;
640 testRW.testChild = FALSE;
641
642 testRWcompare.resultColorPre1 = 0x000000FF;
643 testRWcompare.resultColorPre2 = 0x000000FF;
644 testRWcompare.resultColorPost1 = 0x000000FF;
645 testRWcompare.resultColorPost2 = 0x0000FF00;
646 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
647 testRWcompare.resultNeedsUpdate = TRUE;
648 testRWcompare.resultWmEraseGnd = FALSE;
649 testRWcompare.resultWmNcPaint = FALSE;
650 testRWcompare.resultPaintIndex = 2;
651 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test10 fail\n");
652
653 testRW.testName = L"Test11";
654 testRW.flags = RDW_NOERASE | RDW_ERASE;
655 testRW.useRegion = TRUE;
656 InitRect(&testRW.regRect, 0, 500, 800, 600);
657 testRW.useRect = FALSE;
658 InitRect(&testRW.rectRect, 0, 0, 200, 200);
659 testRW.forcePaint = TRUE;
660 testRW.testChild = FALSE;
661
662 testRWcompare.resultColorPre1 = 0x000000FF;
663 testRWcompare.resultColorPre2 = 0x000000FF;
664 testRWcompare.resultColorPost1 = 0x000000FF;
665 testRWcompare.resultColorPost2 = 0x000000FF;
666 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
667 testRWcompare.resultNeedsUpdate = FALSE;
668 testRWcompare.resultWmEraseGnd = FALSE;
669 testRWcompare.resultWmNcPaint = FALSE;
670 testRWcompare.resultPaintIndex = 1;
671 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test11 fail\n");
672
673 testRW.testName = L"Test12";
675 testRW.useRegion = TRUE;
676 InitRect(&testRW.regRect, 0, 500, 800, 600);
677 testRW.useRect = FALSE;
678 InitRect(&testRW.rectRect, 0, 0, 200, 200);
679 testRW.forcePaint = TRUE;
680 testRW.testChild = FALSE;
681
682 testRWcompare.resultColorPre1 = 0x000000FF;
683 testRWcompare.resultColorPre2 = 0x000000FF;
684 testRWcompare.resultColorPost1 = 0x000000FF;
685 testRWcompare.resultColorPost2 = 0x0000FF00;
686 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
687 testRWcompare.resultNeedsUpdate = TRUE;
688 testRWcompare.resultWmEraseGnd = TRUE;
689 testRWcompare.resultWmNcPaint = FALSE;
690 testRWcompare.resultPaintIndex = 2;
691 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test12 fail\n");
692
693 // RDW_NOFRAME tests
694 testRW.testName = L"Test13";
695 testRW.flags = RDW_NOFRAME;
696 testRW.useRegion = TRUE;
697 InitRect(&testRW.regRect, 0, 500, 800, 600);
698 testRW.useRect = FALSE;
699 InitRect(&testRW.rectRect, 0, 0, 200, 200);
700 testRW.forcePaint = TRUE;
701 testRW.testChild = FALSE;
702
703 testRWcompare.resultColorPre1 = 0x000000FF;
704 testRWcompare.resultColorPre2 = 0x000000FF;
705 testRWcompare.resultColorPost1 = 0x000000FF;
706 testRWcompare.resultColorPost2 = 0x000000FF;
707 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
708 testRWcompare.resultNeedsUpdate = FALSE;
709 testRWcompare.resultWmEraseGnd = FALSE;
710 testRWcompare.resultWmNcPaint = FALSE;
711 testRWcompare.resultPaintIndex = 1;
712 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test13 fail\n");
713
714 testRW.testName = L"Test14";
716 testRW.useRegion = TRUE;
717 InitRect(&testRW.regRect, 0, 500, 800, 600);
718 testRW.useRect = FALSE;
719 InitRect(&testRW.rectRect, 0, 0, 200, 200);
720 testRW.forcePaint = TRUE;
721 testRW.testChild = FALSE;
722
723 testRWcompare.resultColorPre1 = 0x000000FF;
724 testRWcompare.resultColorPre2 = 0x000000FF;
725 testRWcompare.resultColorPost1 = 0x000000FF;
726 testRWcompare.resultColorPost2 = 0x0000FF00;
727 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
728 testRWcompare.resultNeedsUpdate = TRUE;
729 testRWcompare.resultWmEraseGnd = FALSE;
730 testRWcompare.resultWmNcPaint = FALSE;
731 testRWcompare.resultPaintIndex = 2;
732 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test14 fail\n");
733
734 testRW.testName = L"Test15";
736 testRW.useRegion = TRUE;
737 InitRect(&testRW.regRect, 0, 500, 800, 600);
738 testRW.useRect = FALSE;
739 InitRect(&testRW.rectRect, 0, 0, 200, 200);
740 testRW.forcePaint = TRUE;
741 testRW.testChild = FALSE;
742
743 testRWcompare.resultColorPre1 = 0x000000FF;
744 testRWcompare.resultColorPre2 = 0x000000FF;
745 testRWcompare.resultColorPost1 = 0x000000FF;
746 testRWcompare.resultColorPost2 = 0x0000FF00;
747 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
748 testRWcompare.resultNeedsUpdate = TRUE;
749 testRWcompare.resultWmEraseGnd = FALSE;
750 testRWcompare.resultWmNcPaint = FALSE;
751 testRWcompare.resultPaintIndex = 2;
752 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test15 fail\n");
753
754 testRW.testName = L"Test16";
755 testRW.flags = RDW_VALIDATE | RDW_NOFRAME;
756 testRW.useRegion = TRUE;
757 InitRect(&testRW.regRect, 0, 500, 800, 600);
758 testRW.useRect = FALSE;
759 InitRect(&testRW.rectRect, 0, 0, 200, 200);
760 testRW.forcePaint = TRUE;
761 testRW.testChild = FALSE;
762
763 testRWcompare.resultColorPre1 = 0x000000FF;
764 testRWcompare.resultColorPre2 = 0x000000FF;
765 testRWcompare.resultColorPost1 = 0x000000FF;
766 testRWcompare.resultColorPost2 = 0x000000FF;
767 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
768 testRWcompare.resultNeedsUpdate = FALSE;
769 testRWcompare.resultWmEraseGnd = FALSE;
770 testRWcompare.resultWmNcPaint = FALSE;
771 testRWcompare.resultPaintIndex = 1;
772 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test16 fail\n");
773
774 // RDW_NOINTERNALPAINT tests
775 testRW.testName = L"Test17";
776 testRW.flags = RDW_NOINTERNALPAINT;
777 testRW.useRegion = TRUE;
778 InitRect(&testRW.regRect, 0, 500, 800, 600);
779 testRW.useRect = FALSE;
780 InitRect(&testRW.rectRect, 0, 0, 200, 200);
781 testRW.forcePaint = TRUE;
782 testRW.testChild = FALSE;
783
784 testRWcompare.resultColorPre1 = 0x000000FF;
785 testRWcompare.resultColorPre2 = 0x000000FF;
786 testRWcompare.resultColorPost1 = 0x000000FF;
787 testRWcompare.resultColorPost2 = 0x000000FF;
788 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
789 testRWcompare.resultNeedsUpdate = FALSE;
790 testRWcompare.resultWmEraseGnd = FALSE;
791 testRWcompare.resultWmNcPaint = FALSE;
792 testRWcompare.resultPaintIndex = 1;
793 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test17 fail\n");
794
795 testRW.testName = L"Test18";
797 testRW.useRegion = TRUE;
798 InitRect(&testRW.regRect, 0, 500, 800, 600);
799 testRW.useRect = FALSE;
800 InitRect(&testRW.rectRect, 0, 0, 200, 200);
801 testRW.forcePaint = TRUE;
802 testRW.testChild = FALSE;
803
804 testRWcompare.resultColorPre1 = 0x000000FF;
805 testRWcompare.resultColorPre2 = 0x000000FF;
806 testRWcompare.resultColorPost1 = 0x000000FF;
807 testRWcompare.resultColorPost2 = 0x0000FF00;
808 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
809 testRWcompare.resultNeedsUpdate = TRUE;
810 testRWcompare.resultWmEraseGnd = FALSE;
811 testRWcompare.resultWmNcPaint = FALSE;
812 testRWcompare.resultPaintIndex = 2;
813 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test18 fail\n");
814
815 testRW.testName = L"Test19";
817 testRW.useRegion = TRUE;
818 InitRect(&testRW.regRect, 0, 500, 800, 600);
819 testRW.useRect = FALSE;
820 InitRect(&testRW.rectRect, 0, 0, 200, 200);
821 testRW.forcePaint = TRUE;
822 testRW.testChild = FALSE;
823
824 testRWcompare.resultColorPre1 = 0x000000FF;
825 testRWcompare.resultColorPre2 = 0x000000FF;
826 testRWcompare.resultColorPost1 = 0x000000FF;
827 testRWcompare.resultColorPost2 = 0x000000FF;
828 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
829 testRWcompare.resultNeedsUpdate = FALSE;
830 testRWcompare.resultWmEraseGnd = FALSE;
831 testRWcompare.resultWmNcPaint = FALSE;
832 testRWcompare.resultPaintIndex = 1;
833 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test19 fail\n");
834
835 // RDW_ERASENOW tests
836 testRW.testName = L"Test20";
837 testRW.flags = RDW_ERASENOW;
838 testRW.useRegion = TRUE;
839 InitRect(&testRW.regRect, 0, 500, 800, 600);
840 testRW.useRect = FALSE;
841 InitRect(&testRW.rectRect, 0, 0, 200, 200);
842 testRW.forcePaint = TRUE;
843 testRW.testChild = FALSE;
844
845 testRWcompare.resultColorPre1 = 0x000000FF;
846 testRWcompare.resultColorPre2 = 0x000000FF;
847 testRWcompare.resultColorPost1 = 0x000000FF;
848 testRWcompare.resultColorPost2 = 0x000000FF;
849 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
850 testRWcompare.resultNeedsUpdate = FALSE;
851 testRWcompare.resultWmEraseGnd = FALSE;
852 testRWcompare.resultWmNcPaint = FALSE;
853 testRWcompare.resultPaintIndex = 1;
854 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test20 fail\n");
855
856 testRW.testName = L"Test21";
858 testRW.useRegion = TRUE;
859 InitRect(&testRW.regRect, 0, 500, 800, 600);
860 testRW.useRect = FALSE;
861 InitRect(&testRW.rectRect, 0, 0, 200, 200);
862 testRW.forcePaint = TRUE;
863 testRW.testChild = FALSE;
864
865 testRWcompare.resultColorPre1 = 0x000000FF;
866 testRWcompare.resultColorPre2 = 0x000000FF;
867 testRWcompare.resultColorPost1 = 0x000000FF;
868 testRWcompare.resultColorPost2 = 0x0000FF00;
869 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
870 testRWcompare.resultNeedsUpdate = TRUE;
871 testRWcompare.resultWmEraseGnd = FALSE;
872 testRWcompare.resultWmNcPaint = FALSE;
873 testRWcompare.resultPaintIndex = 2;
874 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test21 fail\n");
875
876 testRW.testName = L"Test22";
878 testRW.useRegion = TRUE;
879 InitRect(&testRW.regRect, 0, 500, 800, 600);
880 testRW.useRect = FALSE;
881 InitRect(&testRW.rectRect, 0, 0, 200, 200);
882 testRW.forcePaint = TRUE;
883 testRW.testChild = FALSE;
884
885 testRWcompare.resultColorPre1 = 0x000000FF;
886 testRWcompare.resultColorPre2 = 0x000000FF;
887 testRWcompare.resultColorPost1 = 0x000000FF;
888 testRWcompare.resultColorPost2 = 0x000000FF;
889 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
890 testRWcompare.resultNeedsUpdate = FALSE;
891 testRWcompare.resultWmEraseGnd = FALSE;
892 testRWcompare.resultWmNcPaint = FALSE;
893 testRWcompare.resultPaintIndex = 1;
894 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test22 fail\n");
895
896 // RDW_UPDATENOW tests
897 testRW.testName = L"Test23";
898 testRW.flags = RDW_UPDATENOW;
899 testRW.useRegion = TRUE;
900 InitRect(&testRW.regRect, 0, 500, 800, 600);
901 testRW.useRect = FALSE;
902 InitRect(&testRW.rectRect, 0, 0, 200, 200);
903 testRW.forcePaint = TRUE;
904 testRW.testChild = FALSE;
905
906 testRWcompare.resultColorPre1 = 0x000000FF;
907 testRWcompare.resultColorPre2 = 0x000000FF;
908 testRWcompare.resultColorPost1 = 0x000000FF;
909 testRWcompare.resultColorPost2 = 0x000000FF;
910 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
911 testRWcompare.resultNeedsUpdate = FALSE;
912 testRWcompare.resultWmEraseGnd = FALSE;
913 testRWcompare.resultWmNcPaint = FALSE;
914 testRWcompare.resultPaintIndex = 1;
915 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test23 fail\n");
916
917 testRW.testName = L"Test24";
919 testRW.useRegion = TRUE;
920 InitRect(&testRW.regRect, 0, 500, 800, 600);
921 testRW.useRect = FALSE;
922 InitRect(&testRW.rectRect, 0, 0, 200, 200);
923 testRW.forcePaint = TRUE;
924 testRW.testChild = FALSE;
925
926 testRWcompare.resultColorPre1 = 0x000000FF;
927 testRWcompare.resultColorPre2 = 0x0000FF00;
928 testRWcompare.resultColorPost1 = 0x000000FF;
929 testRWcompare.resultColorPost2 = 0x0000FF00;
930 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
931 testRWcompare.resultNeedsUpdate = FALSE;
932 testRWcompare.resultWmEraseGnd = FALSE;
933 testRWcompare.resultWmNcPaint = FALSE;
934 testRWcompare.resultPaintIndex = 2;
935 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test24 fail\n");
936
937 testRW.testName = L"Test25";
939 testRW.useRegion = TRUE;
940 InitRect(&testRW.regRect, 0, 500, 800, 600);
941 testRW.useRect = FALSE;
942 InitRect(&testRW.rectRect, 0, 0, 200, 200);
943 testRW.forcePaint = TRUE;
944 testRW.testChild = FALSE;
945
946 testRWcompare.resultColorPre1 = 0x000000FF;
947 testRWcompare.resultColorPre2 = 0x000000FF;
948 testRWcompare.resultColorPost1 = 0x000000FF;
949 testRWcompare.resultColorPost2 = 0x000000FF;
950 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
951 testRWcompare.resultNeedsUpdate = FALSE;
952 testRWcompare.resultWmEraseGnd = FALSE;
953 testRWcompare.resultWmNcPaint = FALSE;
954 testRWcompare.resultPaintIndex = 1;
955 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test25 fail\n");
956
957 // RDW_ALLCHILDREN/RDW_NOCHILDREN tests
958 testRW.testName = L"Test26";
959 testRW.flags = RDW_NOCHILDREN;
960 testRW.useRegion = FALSE;
961 InitRect(&testRW.regRect, 0, 500, 800, 600);
962 testRW.useRect = FALSE;
963 InitRect(&testRW.rectRect, 0, 0, 200, 200);
964 testRW.forcePaint = TRUE;
965 testRW.testChild = TRUE;
966
967 testRWcompare.resultColorPre1 = 0x00FF0000;
968 testRWcompare.resultColorPre2 = 0x0000FF00;
969 testRWcompare.resultColorPost1 = 0x00FF0000;
970 testRWcompare.resultColorPost2 = 0x0000FF00;
971 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
972 testRWcompare.resultNeedsUpdate = FALSE;
973 testRWcompare.resultWmEraseGnd = FALSE;
974 testRWcompare.resultWmNcPaint = FALSE;
975 testRWcompare.resultPaintIndex = 1;
976 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test26 fail\n");
977
978 testRW.testName = L"Test27";
980 testRW.useRegion = FALSE;
981 InitRect(&testRW.regRect, 0, 500, 800, 600);
982 testRW.useRect = FALSE;
983 InitRect(&testRW.rectRect, 0, 0, 200, 200);
984 testRW.forcePaint = TRUE;
985 testRW.testChild = TRUE;
986
987 testRWcompare.resultColorPre1 = 0x0000FF00;
988 testRWcompare.resultColorPre2 = 0x0000FF00;
989 testRWcompare.resultColorPost1 = 0x0000FF00;
990 testRWcompare.resultColorPost2 = 0x0000FF00;
991 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
992 testRWcompare.resultNeedsUpdate = FALSE;
993 testRWcompare.resultWmEraseGnd = FALSE;
994 testRWcompare.resultWmNcPaint = FALSE;
995 testRWcompare.resultPaintIndex = 2;
996 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test27 fail\n");
997
998 testRW.testName = L"Test28";
1000 testRW.useRegion = FALSE;
1001 InitRect(&testRW.regRect, 0, 500, 800, 600);
1002 testRW.useRect = FALSE;
1003 InitRect(&testRW.rectRect, 0, 0, 200, 200);
1004 testRW.forcePaint = TRUE;
1005 testRW.testChild = TRUE;
1006
1007 testRWcompare.resultColorPre1 = 0x00FF0000;
1008 testRWcompare.resultColorPre2 = 0x0000FF00;
1009 testRWcompare.resultColorPost1 = 0x00FF0000;
1010 testRWcompare.resultColorPost2 = 0x0000FF00;
1011 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1012 testRWcompare.resultNeedsUpdate = FALSE;
1013 testRWcompare.resultWmEraseGnd = FALSE;
1014 testRWcompare.resultWmNcPaint = FALSE;
1015 testRWcompare.resultPaintIndex = 1;
1016 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test28 fail\n");
1017
1018 testRW.testName = L"Test29";
1019 testRW.flags = RDW_ALLCHILDREN;
1020 testRW.useRegion = FALSE;
1021 InitRect(&testRW.regRect, 0, 500, 800, 600);
1022 testRW.useRect = FALSE;
1023 InitRect(&testRW.rectRect, 0, 0, 200, 200);
1024 testRW.forcePaint = TRUE;
1025 testRW.testChild = TRUE;
1026
1027 testRWcompare.resultColorPre1 = 0x00FF0000;
1028 testRWcompare.resultColorPre2 = 0x0000FF00;
1029 testRWcompare.resultColorPost1 = 0x00FF0000;
1030 testRWcompare.resultColorPost2 = 0x0000FF00;
1031 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1032 testRWcompare.resultNeedsUpdate = FALSE;
1033 testRWcompare.resultWmEraseGnd = FALSE;
1034 testRWcompare.resultWmNcPaint = FALSE;
1035 testRWcompare.resultPaintIndex = 1;
1036 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test29 fail\n");
1037
1038 testRW.testName = L"Test30";
1040 testRW.useRegion = FALSE;
1041 InitRect(&testRW.regRect, 0, 500, 800, 600);
1042 testRW.useRect = FALSE;
1043 InitRect(&testRW.rectRect, 0, 0, 200, 200);
1044 testRW.forcePaint = TRUE;
1045 testRW.testChild = TRUE;
1046
1047 testRWcompare.resultColorPre1 = 0x00FF0000;
1048 testRWcompare.resultColorPre2 = 0x0000FF00;
1049 testRWcompare.resultColorPre1 = 0x00FF0000;
1050 testRWcompare.resultColorPost2 = 0x0000FF00;
1051 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1052 testRWcompare.resultNeedsUpdate = FALSE;
1053 testRWcompare.resultWmEraseGnd = FALSE;
1054 testRWcompare.resultWmNcPaint = FALSE;
1055 testRWcompare.resultPaintIndex = 2;
1056 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test30 fail\n");
1057
1058 testRW.testName = L"Test31";
1060 testRW.useRegion = FALSE;
1061 InitRect(&testRW.regRect, 0, 500, 800, 600);
1062 testRW.useRect = FALSE;
1063 InitRect(&testRW.rectRect, 0, 0, 200, 200);
1064 testRW.forcePaint = TRUE;
1065 testRW.testChild = TRUE;
1066
1067 testRWcompare.resultColorPre1 = 0x00FF0000;
1068 testRWcompare.resultColorPre2 = 0x0000FF00;
1069 testRWcompare.resultColorPost1 = 0x00FF0000;
1070 testRWcompare.resultColorPost2 = 0x0000FF00;
1071 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1072 testRWcompare.resultNeedsUpdate = FALSE;
1073 testRWcompare.resultWmEraseGnd = FALSE;
1074 testRWcompare.resultWmNcPaint = FALSE;
1075 testRWcompare.resultPaintIndex = 1;
1076 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test31 fail\n");
1077
1078 testRW.testName = L"Test32";
1079 testRW.flags = RDW_NOCHILDREN;
1080 testRW.useRegion = TRUE;
1081 InitRect(&testRW.regRect, 0, 500, 800, 600);
1082 testRW.useRect = FALSE;
1083 InitRect(&testRW.rectRect, 0, 0, 200, 200);
1084 testRW.forcePaint = TRUE;
1085 testRW.testChild = TRUE;
1086
1087 testRWcompare.resultColorPre1 = 0x00FF0000;
1088 testRWcompare.resultColorPre2 = 0x0000FF00;
1089 testRWcompare.resultColorPost1 = 0x00FF0000;
1090 testRWcompare.resultColorPost2 = 0x0000FF00;
1091 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1092 testRWcompare.resultNeedsUpdate = FALSE;
1093 testRWcompare.resultWmEraseGnd = FALSE;
1094 testRWcompare.resultWmNcPaint = FALSE;
1095 testRWcompare.resultPaintIndex = 1;
1096 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test32 fail\n");
1097
1098 testRW.testName = L"Test33";
1100 testRW.useRegion = TRUE;
1101 InitRect(&testRW.regRect, 0, 500, 800, 600);
1102 testRW.useRect = FALSE;
1103 InitRect(&testRW.rectRect, 0, 0, 200, 200);
1104 testRW.forcePaint = TRUE;
1105 testRW.testChild = TRUE;
1106
1107 testRWcompare.resultColorPre1 = 0x00FF0000;
1108 testRWcompare.resultColorPre2 = 0x0000FF00;
1109 testRWcompare.resultColorPre1 = 0x00FF0000;
1110 testRWcompare.resultColorPost2 = 0x0000FF00;
1111 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1112 testRWcompare.resultNeedsUpdate = FALSE;
1113 testRWcompare.resultWmEraseGnd = FALSE;
1114 testRWcompare.resultWmNcPaint = FALSE;
1115 testRWcompare.resultPaintIndex = 2;
1116 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test33 fail\n");
1117
1118 testRW.testName = L"Test34";
1120 testRW.useRegion = TRUE;
1121 InitRect(&testRW.regRect, 0, 500, 800, 600);
1122 testRW.useRect = FALSE;
1123 InitRect(&testRW.rectRect, 0, 0, 200, 200);
1124 testRW.forcePaint = TRUE;
1125 testRW.testChild = TRUE;
1126
1127 testRWcompare.resultColorPre1 = 0x00FF0000;
1128 testRWcompare.resultColorPre2 = 0x0000FF00;
1129 testRWcompare.resultColorPost1 = 0x00FF0000;
1130 testRWcompare.resultColorPost2 = 0x0000FF00;
1131 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1132 testRWcompare.resultNeedsUpdate = FALSE;
1133 testRWcompare.resultWmEraseGnd = FALSE;
1134 testRWcompare.resultWmNcPaint = FALSE;
1135 testRWcompare.resultPaintIndex = 1;
1136 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test34 fail\n");
1137
1138 // rect defined area tests
1139 testRW.testName = L"Test35";
1140 testRW.flags = 0;
1141 testRW.useRegion = FALSE;
1142 InitRect(&testRW.regRect, 0, 500, 800, 600);
1143 testRW.useRect = TRUE;
1144 InitRect(&testRW.rectRect, 0, 500, 800, 600);
1145 testRW.forcePaint = TRUE;
1146 testRW.testChild = FALSE;
1147
1148 testRWcompare.resultColorPre1 = 0x000000FF;
1149 testRWcompare.resultColorPre2 = 0x000000FF;
1150 testRWcompare.resultColorPost1 = 0x000000FF;
1151 testRWcompare.resultColorPost2 = 0x000000FF;
1152 InitRect(&testRWcompare.resultUpdateRect, 0, 0, 200, 200);
1153 testRWcompare.resultNeedsUpdate = FALSE;
1154 testRWcompare.resultWmEraseGnd = FALSE;
1155 testRWcompare.resultWmNcPaint = FALSE;
1156 testRWcompare.resultPaintIndex = 1;
1157 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test35 fail\n");
1158
1159 testRW.testName = L"Test36";
1161 testRW.useRegion = FALSE;
1162 InitRect(&testRW.regRect, 0, 500, 800, 600);
1163 testRW.useRect = TRUE;
1164 InitRect(&testRW.rectRect, 0, 500, 800, 600);
1165 testRW.forcePaint = TRUE;
1166 testRW.testChild = FALSE;
1167
1168 testRWcompare.resultColorPre1 = 0x000000FF;
1169 testRWcompare.resultColorPre2 = 0x000000FF;
1170 testRWcompare.resultColorPost1 = 0x000000FF;
1171 testRWcompare.resultColorPost2 = 0x0000FF00;
1172 InitRect(&testRWcompare.resultUpdateRect, 0, 500, 800, 600);
1173 testRWcompare.resultNeedsUpdate = TRUE;
1174 testRWcompare.resultWmEraseGnd = FALSE;
1175 testRWcompare.resultWmNcPaint = FALSE;
1176 testRWcompare.resultPaintIndex = 2;
1177 ok(0 == TestRedrawWindow2(&testRW, &testRWcompare),"Test36 fail\n");
1178}
1179
1181{
1184}
LRESULT CALLBACK ChildWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: RedrawWindow.c:142
void FlagsRedrawWindowTest()
Definition: RedrawWindow.c:435
BOOL resultWmNcPaint
Definition: RedrawWindow.c:15
int paintIndex
Definition: RedrawWindow.c:16
void InitRect(RECT *rect, int left, int top, int right, int bottom)
Definition: RedrawWindow.c:428
static LRESULT CALLBACK WndProc(_In_ HWND hWnd, _In_ UINT message, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: RedrawWindow.c:22
UINT TestRedrawWindow2(STRUCT_TestRedrawWindow *ptestRW, STRUCT_TestRedrawWindowCompare *ptestRWcompare)
Definition: RedrawWindow.c:348
static DWORD dwThreadId
Definition: RedrawWindow.c:11
void TestRedrawWindow(STRUCT_TestRedrawWindow *ptestRW)
Definition: RedrawWindow.c:238
static BOOL got_paint
Definition: RedrawWindow.c:12
const wchar_t CHILD_CLASS_NAME[]
Definition: RedrawWindow.c:17
BOOL resultWmEraseGnd
Definition: RedrawWindow.c:14
void DrawContent(HDC hdc, RECT *rect, COLORREF color)
Definition: RedrawWindow.c:95
void ServeSomeMessages(int messageTime, int messageCount)
Definition: RedrawWindow.c:218
void GetMessageRedrawWindowTest()
Definition: RedrawWindow.c:37
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: RedrawWindow.c:106
Arabic default style
Definition: afstyles.h:94
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
static ULONGLONG startTime
Definition: main.c:113
#define RGB(r, g, b)
Definition: precomp.h:71
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint color
Definition: glext.h:6243
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLint GLint bottom
Definition: glext.h:7726
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static HRGN hRgn
Definition: mapping.c:33
#define _In_
Definition: ms_sal.h:308
#define RECORD_MESSAGE(...)
Definition: msgtrace.h:60
#define TRACE_CACHE()
Definition: msgtrace.h:58
@ POST
Definition: msgtrace.h:7
unsigned int UINT
Definition: ndis.h:50
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VISIBLE
Definition: pedump.c:620
#define DefWindowProc
Definition: ros2win.h:31
#define disable_success_count
Definition: test.h:184
& rect
Definition: startmenu.cpp:1413
const wchar_t * testName
Definition: RedrawWindow.c:176
LPCWSTR lpszClassName
Definition: winuser.h:3188
HINSTANCE hInstance
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3180
Definition: tftpd.h:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
static __inline ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName)
int ret
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
#define GetModuleHandle
Definition: winbase.h:3827
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define TRANSPARENT
Definition: wingdi.h:950
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define WM_PAINT
Definition: winuser.h:1623
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1628
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define DT_CENTER
Definition: winuser.h:527
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SYNCPAINT
Definition: winuser.h:1693
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define RDW_NOINTERNALPAINT
Definition: winuser.h:1220
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define RDW_UPDATENOW
Definition: winuser.h:1223
#define RDW_ERASE
Definition: winuser.h:1214
#define RDW_NOCHILDREN
Definition: winuser.h:1225
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2706
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define RDW_ALLCHILDREN
Definition: winuser.h:1224
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)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define PM_REMOVE
Definition: winuser.h:1199
#define RDW_ERASENOW
Definition: winuser.h:1222
#define RDW_FRAME
Definition: winuser.h:1215
BOOL WINAPI UpdateWindow(_In_ HWND)
#define PeekMessage
Definition: winuser.h:5842
HDC WINAPI GetDC(_In_opt_ HWND)
#define DT_VCENTER
Definition: winuser.h:543
#define CW_USEDEFAULT
Definition: winuser.h:225
#define SW_SHOW
Definition: winuser.h:778
#define WM_DESTROY
Definition: winuser.h:1612
#define RDW_NOFRAME
Definition: winuser.h:1219
#define DispatchMessage
Definition: winuser.h:5777
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define RDW_INTERNALPAINT
Definition: winuser.h:1216
#define RDW_NOERASE
Definition: winuser.h:1218
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
#define RDW_VALIDATE
Definition: winuser.h:1221
BOOL WINAPI DestroyWindow(_In_ HWND)
#define RDW_INVALIDATE
Definition: winuser.h:1217
#define WM_NCPAINT
Definition: winuser.h:1690