ReactOS  0.4.15-dev-1374-g8d3e80e
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");
56  got_paint = FALSE;
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 
84  TRACE_CACHE();
85 
88 }
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define PeekMessage
Definition: winuser.h:5805
static BOOL got_paint
Definition: RedrawWindow.c:11
#define TRUE
Definition: types.h:120
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
HWND hWnd
Definition: settings.c:17
static HRGN hRgn
Definition: mapping.c:33
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static DWORD dwThreadId
Definition: RedrawWindow.c:10
#define SW_SHOW
Definition: winuser.h:769
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
static __inline ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2627
static LRESULT CALLBACK WndProc(_In_ HWND hWnd, _In_ UINT message, _In_ WPARAM wParam, _In_ LPARAM lParam)
Definition: RedrawWindow.c:16
#define WM_PAINT
Definition: winuser.h:1602
int ret
Definition: msgtrace.h:7
static const WCHAR L[]
Definition: oid.c:1250
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 RDW_INTERNALPAINT
Definition: winuser.h:1199
#define TRACE_CACHE()
Definition: msgtrace.h:58
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
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
#define msg(x)
Definition: auth_time.c:54
#define RECORD_MESSAGE(...)
Definition: msgtrace.h:60
#define PM_REMOVE
Definition: winuser.h:1182
#define RDW_INVALIDATE
Definition: winuser.h:1200

◆ 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  {
26  got_paint = TRUE;
27  }
29 }
Definition: tftpd.h:59
static BOOL got_paint
Definition: RedrawWindow.c:11
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static DWORD dwThreadId
Definition: RedrawWindow.c:10
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define disable_success_count
Definition: test.h:170
#define WM_PAINT
Definition: winuser.h:1602
#define ok(value,...)
Definition: atltest.h:57
LPARAM lParam
Definition: combotst.c:139

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().