ReactOS 0.4.15-dev-8021-g7ce96fd
GetPeekMessage.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for GetMessage/PeekMessage
5 * PROGRAMMERS: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8#include "precomp.h"
9
11{
12 MSG msg;
13
15
16 ok(GetMessage(&msg, hWnd, 0, 0) == -1, "\n");
17 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetLastError() = %lu\n", GetLastError());
18}
19
21{
22 MSG msg;
23
25
26 ok(PeekMessage(&msg, hWnd, 0, 0, PM_NOREMOVE) == 0, "\n");
27 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetLastError() = %lu\n", GetLastError());
28}
29
30START_TEST(GetPeekMessage)
31{
32 HWND hWnd = CreateWindowExW(0, L"EDIT", L"miau", 0, CW_USEDEFAULT, CW_USEDEFAULT,
35 /* make sure we pass an invalid handle to GetMessage/PeekMessage */
36 ok(DestroyWindow(hWnd), "\n");
37
40}
void Test_PeekMessage(HWND hWnd)
void Test_GetMessage(HWND hWnd)
#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
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define L(x)
Definition: ntvdm.h:50
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define GetModuleHandle
Definition: winbase.h:3827
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define DNS_ERROR_RCODE_NXRRSET
Definition: winerror.h:1855
#define GetMessage
Definition: winuser.h:5790
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 PeekMessage
Definition: winuser.h:5830
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PM_NOREMOVE
Definition: winuser.h:1195