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 11 static DWORD dwThreadId; 12 static BOOL got_paint; 13 14 BOOL resultWmEraseGnd = FALSE; 15 BOOL resultWmNcPaint = FALSE; 16 int paintIndex = 0; 17 const wchar_t CHILD_CLASS_NAME[] = L"ChildWindowClass"; 18 19 static 20 LRESULT 21 CALLBACK 22 WndProc( 23 _In_ HWND hWnd, 24 _In_ UINT message, 25 _In_ WPARAM wParam, 26 _In_ LPARAM lParam) 27 { 28 disable_success_count 29 ok(GetCurrentThreadId() == dwThreadId, "Thread 0x%lx instead of 0x%lx\n", GetCurrentThreadId(), dwThreadId); 30 if (message == WM_PAINT) 31 { 32 got_paint = TRUE; 33 } 34 return DefWindowProcW(hWnd, message, wParam, lParam); 35 } 36 37 void GetMessageRedrawWindowTest() 38 { 39 HWND hWnd; 40 MSG msg; 41 HRGN hRgn; 42 BOOL ret; 43 int i; 44 45 SetCursorPos(0,0); 46 47 dwThreadId = GetCurrentThreadId(); 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 53 ShowWindow(hWnd, SW_SHOW); 54 55 while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) 56 { 57 DispatchMessageA( &msg ); 58 } 59 60 ok(got_paint == TRUE, "Did not process WM_PAINT message\n"); 61 got_paint = FALSE; 62 63 hRgn = CreateRectRgn(0, 0, 1, 1); 64 ok(hRgn != NULL, "CreateRectRgn failed\n"); 65 ret = RedrawWindow(hWnd, NULL, hRgn, RDW_INTERNALPAINT | RDW_INVALIDATE); 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 { 82 DispatchMessageA( &msg ); 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 89 TRACE_CACHE(); 90 91 DeleteObject(hRgn); 92 DestroyWindow(hWnd); 93 } 94 95 void DrawContent(HDC hdc, RECT* rect, COLORREF color) 96 { 97 HBRUSH hBrush = CreateSolidBrush(color); 98 FillRect(hdc, rect, hBrush); 99 DeleteObject(hBrush); 100 101 SetBkMode(hdc, TRANSPARENT); 102 SetTextColor(hdc, RGB(255, 255, 255)); 103 DrawTextW(hdc, L"Test RedrawWindow", -1, rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE); 104 } 105 106 LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 107 { 108 switch (uMsg) 109 { 110 case WM_DESTROY: 111 { 112 PostQuitMessage(0); 113 return 0; 114 } 115 case WM_PAINT: 116 { 117 PAINTSTRUCT ps; 118 HDC hdc = BeginPaint(hwnd, &ps); 119 RECT rect; 120 GetClientRect(hwnd, &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) 129 resultWmEraseGnd = TRUE; 130 return 0; 131 } 132 case WM_NCPAINT: 133 { 134 if (paintIndex != 0) 135 resultWmNcPaint = TRUE; 136 return 0; 137 } 138 } 139 return DefWindowProc(hwnd, uMsg, wParam, lParam); 140 } 141 142 LRESULT CALLBACK ChildWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 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 { 167 PostQuitMessage(0); 168 return 0; 169 } 170 } 171 return DefWindowProc(hwnd, uMsg, wParam, lParam); 172 } 173 174 typedef struct STRUCT_TestRedrawWindow 175 { 176 const wchar_t* testName; 177 DWORD flags; 178 BOOL useRegion; 179 RECT regRect; 180 BOOL useRect; 181 RECT rectRect; 182 BOOL forcePaint; 183 BOOL redrawResult; 184 int testPixelPre1x; 185 int testPixelPre1y; 186 int testPixelPre2x; 187 int testPixelPre2y; 188 int testPixelPost1x; 189 int testPixelPost1y; 190 int testPixelPost2x; 191 int testPixelPost2y; 192 int testChild; 193 COLORREF resultColorPre1; 194 COLORREF resultColorPre2; 195 COLORREF resultColorPost1; 196 COLORREF resultColorPost2; 197 RECT resultUpdateRect; 198 BOOL resultNeedsUpdate; 199 BOOL resultRedraw; 200 BOOL resultWmEraseGnd; 201 BOOL resultWmNcPaint; 202 int resultPaintIndex; 203 } STRUCT_TestRedrawWindow; 204 205 typedef struct STRUCT_TestRedrawWindowCompare 206 { 207 COLORREF resultColorPre1; 208 COLORREF resultColorPre2; 209 COLORREF resultColorPost1; 210 COLORREF resultColorPost2; 211 RECT resultUpdateRect; 212 BOOL resultNeedsUpdate; 213 BOOL resultWmEraseGnd; 214 BOOL resultWmNcPaint; 215 int resultPaintIndex; 216 } STRUCT_TestRedrawWindowCompare; 217 218 void ServeSomeMessages(int messageTime, int messageCount) 219 { 220 DWORD startTime; 221 222 MSG msg = { 0 }; 223 startTime = GetTickCount(); 224 while (GetTickCount() - startTime < messageTime * messageCount) 225 { 226 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 227 { 228 TranslateMessage(&msg); 229 DispatchMessage(&msg); 230 } 231 else 232 { 233 Sleep(messageTime); 234 } 235 } 236 } 237 238 void TestRedrawWindow(STRUCT_TestRedrawWindow* ptestRW) { 239 DWORD style; 240 int width; 241 int height; 242 HWND hChildWnd = NULL; 243 HRGN RgnUpdate; 244 RECT* prect; 245 246 resultWmEraseGnd = FALSE; 247 resultWmNcPaint = FALSE; 248 paintIndex = 0; 249 250 WNDCLASSW wc = { 0 }; 251 wc.lpfnWndProc = WindowProc; 252 wc.hInstance = GetModuleHandle(NULL); 253 wc.lpszClassName = ptestRW->testName; 254 RegisterClassW(&wc); 255 RECT rectWin = { 0, 0, 800, 600 }; 256 style = WS_OVERLAPPEDWINDOW; 257 AdjustWindowRectEx(&rectWin, style, FALSE, 0); 258 width = rectWin.right - rectWin.left; 259 height = rectWin.bottom - rectWin.top; 260 HWND hwnd = CreateWindowExW(0, wc.lpszClassName, wc.lpszClassName, WS_OVERLAPPEDWINDOW, 261 CW_USEDEFAULT, CW_USEDEFAULT, width, height, NULL, NULL, GetModuleHandle(NULL), NULL); 262 if (hwnd == NULL) 263 return; 264 265 ShowWindow(hwnd, SW_SHOW); 266 if(!ptestRW->testChild) 267 UpdateWindow(hwnd); 268 269 if (ptestRW->testChild) 270 { 271 WNDCLASSW wcChild = { 0 }; 272 wcChild.lpfnWndProc = ChildWindowProc; 273 wcChild.hInstance = GetModuleHandle(NULL); 274 wcChild.lpszClassName = CHILD_CLASS_NAME; 275 RegisterClassW(&wcChild); 276 277 hChildWnd = CreateWindowExW( 278 0, 279 CHILD_CLASS_NAME, 280 L"Child Window", 281 WS_CHILD | WS_VISIBLE, 282 10, 10, 200, 200, 283 hwnd, 284 NULL, 285 GetModuleHandle(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)); 293 ReleaseDC(hwnd, hdc); 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); 322 ReleaseDC(hwnd, hdc); 323 324 ptestRW->resultNeedsUpdate = GetUpdateRect(hwnd, &ptestRW->resultUpdateRect, FALSE); 325 326 if (ptestRW->forcePaint) 327 { 328 UpdateWindow(hwnd); 329 } 330 331 hdc = GetDC(hwnd); 332 ptestRW->resultColorPost1 = GetPixel(hdc, ptestRW->testPixelPost1x, ptestRW->testPixelPost1y); 333 ptestRW->resultColorPost2 = GetPixel(hdc, ptestRW->testPixelPost2x, ptestRW->testPixelPost2y); 334 ReleaseDC(hwnd, hdc); 335 336 ptestRW->resultWmEraseGnd = resultWmEraseGnd; 337 ptestRW->resultWmNcPaint = resultWmNcPaint; 338 ptestRW->resultPaintIndex = paintIndex; 339 340 if (RgnUpdate) DeleteObject(RgnUpdate); 341 342 if (hChildWnd != NULL) 343 DestroyWindow(hChildWnd); 344 if (hwnd != NULL) 345 DestroyWindow(hwnd); 346 } 347 348 UINT TestRedrawWindow2(STRUCT_TestRedrawWindow* ptestRW, STRUCT_TestRedrawWindowCompare* ptestRWcompare) 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 428 void 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 435 void FlagsRedrawWindowTest() 436 { 437 STRUCT_TestRedrawWindow testRW; 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"; 593 testRW.flags = RDW_INVALIDATE | RDW_INTERNALPAINT; 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"; 634 testRW.flags = RDW_INVALIDATE | RDW_NOERASE; 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"; 674 testRW.flags = RDW_INVALIDATE | RDW_NOERASE | RDW_ERASE; 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"; 715 testRW.flags = RDW_INVALIDATE | RDW_NOFRAME; 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"; 735 testRW.flags = RDW_INVALIDATE | RDW_VALIDATE | RDW_NOFRAME; 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"; 796 testRW.flags = RDW_INVALIDATE | RDW_NOINTERNALPAINT; 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"; 816 testRW.flags = RDW_VALIDATE | RDW_NOINTERNALPAINT; 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"; 857 testRW.flags = RDW_INVALIDATE | RDW_ERASENOW; 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"; 877 testRW.flags = RDW_VALIDATE | RDW_ERASENOW; 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"; 918 testRW.flags = RDW_INVALIDATE | RDW_UPDATENOW; 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"; 938 testRW.flags = RDW_VALIDATE | RDW_UPDATENOW; 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"; 979 testRW.flags = RDW_INVALIDATE | RDW_NOCHILDREN; 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"; 999 testRW.flags = RDW_VALIDATE | RDW_NOCHILDREN; 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"; 1039 testRW.flags = RDW_INVALIDATE | RDW_ALLCHILDREN; 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"; 1059 testRW.flags = RDW_VALIDATE | RDW_ALLCHILDREN; 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"; 1099 testRW.flags = RDW_INVALIDATE | RDW_NOCHILDREN; 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"; 1119 testRW.flags = RDW_VALIDATE | RDW_NOCHILDREN; 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"; 1160 testRW.flags = RDW_INVALIDATE | RDW_ERASENOW; 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 1180 START_TEST(RedrawWindow) 1181 { 1182 FlagsRedrawWindowTest(); 1183 GetMessageRedrawWindowTest(); 1184 } 1185