ReactOS 0.4.15-dev-7654-g6bc40d3
RedrawWindow.c File Reference
#include "precomp.h"
Include dependency graph for RedrawWindow.c:

Go to the source code of this file.

Functions

static LRESULT CALLBACK WndProc (_In_ HWND hWnd, _In_ UINT message, _In_ WPARAM wParam, _In_ LPARAM lParam)
 
 START_TEST (RedrawWindow)
 

Variables

static DWORD dwThreadId
 
static BOOL got_paint
 

Function Documentation

◆ START_TEST()

START_TEST ( RedrawWindow  )

Definition at line 32 of file RedrawWindow.c.

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 msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
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 RECORD_MESSAGE(...)
Definition: msgtrace.h:60
#define TRACE_CACHE()
Definition: msgtrace.h:58
@ POST
Definition: msgtrace.h:7
#define L(x)
Definition: ntvdm.h:50
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
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define WM_PAINT
Definition: winuser.h:1619
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)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2645
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:1195
#define PeekMessage
Definition: winuser.h:5829
#define SW_SHOW
Definition: winuser.h:774
#define RDW_INTERNALPAINT
Definition: winuser.h:1212
BOOL WINAPI DestroyWindow(_In_ HWND)
#define RDW_INVALIDATE
Definition: winuser.h:1213

◆ WndProc()

static LRESULT CALLBACK WndProc ( _In_ HWND  hWnd,
_In_ UINT  message,
_In_ WPARAM  wParam,
_In_ LPARAM  lParam 
)
static

Definition at line 16 of file RedrawWindow.c.

21{
23 ok(GetCurrentThreadId() == dwThreadId, "Thread 0x%lx instead of 0x%lx\n", GetCurrentThreadId(), dwThreadId);
24 if (message == WM_PAINT)
25 {
27 }
29}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define disable_success_count
Definition: test.h:181
Definition: tftpd.h:60
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by START_TEST().

Variable Documentation

◆ dwThreadId

DWORD dwThreadId
static

Definition at line 10 of file RedrawWindow.c.

Referenced by START_TEST(), and WndProc().

◆ got_paint

BOOL got_paint
static

Definition at line 11 of file RedrawWindow.c.

Referenced by START_TEST(), and WndProc().