ReactOS 0.4.15-dev-8058-ga7cbb60
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 */
7
8#include "precomp.h"
9
12
13static
21{
23 ok(GetCurrentThreadId() == dwThreadId, "Thread 0x%lx instead of 0x%lx\n", GetCurrentThreadId(), dwThreadId);
24 if (message == WM_PAINT)
25 {
27 }
29}
30
31
33{
34 HWND hWnd;
35 MSG msg;
36 HRGN hRgn;
37 BOOL ret;
38 int i;
39
40 SetCursorPos(0,0);
41
43 RegisterSimpleClass(WndProc, L"CreateTest");
44
45 hWnd = CreateWindowExW(0, L"CreateTest", NULL, 0, 10, 10, 20, 20, NULL, NULL, 0, NULL);
46 ok(hWnd != NULL, "CreateWindow failed\n");
47
49
50 while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
51 {
53 }
54
55 ok(got_paint == TRUE, "Did not process WM_PAINT message\n");
57
58 hRgn = CreateRectRgn(0, 0, 1, 1);
59 ok(hRgn != NULL, "CreateRectRgn failed\n");
61 ok(ret == TRUE, "RedrawWindow failed\n");
62
63 i = 0;
64 while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
65 {
66 RECORD_MESSAGE(1, msg.message, POST, 0, 0);
67 if (msg.message == WM_PAINT)
68 {
69 i++;
70 if (i == 10)
71 {
72 ok(got_paint == FALSE, "Received unexpected WM_PAINT message\n");
73 }
74 }
75 if (msg.message != WM_PAINT || i >= 10)
76 {
78 }
79 }
80
81 ok(i == 10, "Received %d WM_PAINT messages\n", i);
82 ok(got_paint == TRUE, "Did not process WM_PAINT message\n");
83
85
88}
static LRESULT CALLBACK WndProc(_In_ HWND hWnd, _In_ UINT message, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: RedrawWindow.c:16
static DWORD dwThreadId
Definition: RedrawWindow.c:10
static BOOL got_paint
Definition: RedrawWindow.c:11
#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
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
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
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
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
#define L(x)
Definition: ntvdm.h:50
#define disable_success_count
Definition: test.h:184
Definition: tftpd.h:60
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
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define WM_PAINT
Definition: winuser.h:1620
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2693
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 PM_REMOVE
Definition: winuser.h:1196
#define PeekMessage
Definition: winuser.h:5830
#define SW_SHOW
Definition: winuser.h:775
#define RDW_INTERNALPAINT
Definition: winuser.h:1213
BOOL WINAPI DestroyWindow(_In_ HWND)
#define RDW_INVALIDATE
Definition: winuser.h:1214